lkml.org 
[lkml]   [2023]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] staging: qlge: Replace strncpy with strscpy
On Mon, Oct 09, 2023 at 09:44:37AM -0700, Kees Cook wrote:
> Thanks for working on this! Doing these replacements needs analysis of
> several issues that should be described in the commit log:
>
> - is the destination an %NUL-terminated string? (strncpy can produce
> non-%NUL-terminated strings and sometimes this is intentional.)
>
> - is the source %NUL-terminated? (Sometimes strncpy is used when memcpy,
> kmemdup_nul, or other things should be used.)
>
> - does the destination need to be %NUL padded? (strncpy does this
> padding, but it isn't always obvious if it's needed.) When padding is
> needed, strscpy_pad() should be used.

Thank you for the feedback Kees, I really appreciate it

Regards,

Ricardo Lopes

\
 
 \ /
  Last update: 2023-10-09 20:55    [W:0.096 / U:1.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site