lkml.org 
[lkml]   [2018]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: qed: use correct strncpy() size
From
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 2 Feb 2018 16:44:47 +0100

> passing the strlen() of the source string as the destination
> length is pointless, and gcc-8 now warns about it:
>
> drivers/net/ethernet/qlogic/qed/qed_debug.c: In function 'qed_grc_dump':
> include/linux/string.h:253: error: 'strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
>
> This changes qed_grc_dump_big_ram() to instead uses the length of
> the destination buffer, and use strscpy() to guarantee nul-termination.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied.

\
 
 \ /
  Last update: 2018-02-03 01:43    [W:0.062 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site