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

2024-02-23 Thread Kees Cook
On Fri, Feb 23, 2024 at 10:23:09PM +, 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 4/7] scsi: qla4xxx: replace deprecated strncpy with strscpy

2024-02-23 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