[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKYAXd80SpFBmp1JTHz5VfG14jy8+_RoHU_BL6-bFr_wcOduUQ@mail.gmail.com>
Date: Thu, 20 Nov 2025 17:35:38 +0900
From: Namjae Jeon <linkinjeon@...nel.org>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: David Laight <david.laight.linux@...il.com>, Steve French <smfrench@...il.com>,
Sergey Senozhatsky <senozhatsky@...omium.org>, Tom Talpey <tom@...pey.com>, linux-cifs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] ksmbd: Replace strcpy + strcat to improve convert_to_nt_pathname
On Wed, Nov 19, 2025 at 10:03 PM Thorsten Blum <thorsten.blum@...ux.dev> wrote:
>
> strcpy() is deprecated [1] and using strcat() is discouraged. Replace
> them by assigning the prefix directly and by using memcpy() to copy the
> pathname. Using memcpy() is safe because we already know the length of
> the source string and that it is guaranteed to be NUL-terminated.
>
> Allocate only as many bytes as needed and replace kzalloc() with
> kmalloc() since memcpy() overwrites the entire buffer anyway.
>
> Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1]
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
Applied it to #ksmbd-for-next-next.
Thanks!
Powered by blists - more mailing lists