lkml.org 
[lkml]   [2023]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: 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@intel.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

\
 
 \ /
  Last update: 2023-09-28 11:37    [W:7.200 / U:1.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site