Re: [PATCH v2 4/7] scsi: qla4xxx: replace deprecated strncpy with strscpy

2024-02-28 Thread Kees Cook
On Wed, Feb 28, 2024 at 10:59:04PM +, Justin Stitt wrote: > Replace 3 instances of strncpy in ql4_mbx.c > > No bugs exist in the current implementation as some care was taken to > ensure the write length was decreased by one to leave some space for a > NUL-byte. However, instead of using strnc

[PATCH v2 4/7] scsi: qla4xxx: replace deprecated strncpy with strscpy

2024-02-28 Thread Justin Stitt
Replace 3 instances of strncpy in ql4_mbx.c No bugs exist in the current implementation as some care was taken to ensure the write length was decreased by one to leave some space for a NUL-byte. However, instead of using strncpy(dest, src, LEN-1) we can opt for strscpy(dest, src, sizeof(dest)) whi