[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72=J=bO-Q0=gMDyiRgvbF_Vre39iqbEnaEeDho4Vo2ox6A@mail.gmail.com>
Date: Thu, 28 Sep 2023 11:36:46 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: kernel test robot <lkp@...el.com>,
Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...nel.org>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Kees Cook <keescook@...omium.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Subject: Re: drivers/md/dm-cache-metadata.c:1705:9: warning: 'strncpy'
specified bound 16 equals destination size
On Thu, Sep 28, 2023 at 12:24 AM kernel test robot <lkp@...el.com> wrote:
>
> In function 'write_hints',
> inlined from 'dm_cache_write_hints' at drivers/md/dm-cache-metadata.c:1729:6:
> >> drivers/md/dm-cache-metadata.c:1705:9: warning: 'strncpy' specified bound 16 equals destination size [-Wstringop-truncation]
> 1705 | strncpy(cmd->policy_name, policy_name, sizeof(cmd->policy_name));
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This looks fine given the check above it. In any case, since it
appears the code wants to terminate the string, this should use
`strscpy*()`, right?
Cheers,
Miguel
Powered by blists - more mailing lists