scsi: mpi3mr: Replace deprecated strncpy() with assignments
authorJustin Stitt <justinstitt@google.com>
Tue, 5 Mar 2024 23:34:36 +0000 (23:34 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 10 Mar 2024 22:37:43 +0000 (18:37 -0400)
commit8c8e2422bde198efa57566d768400f73cc485aad
tree7206a10d909c596a3c3744fa0ef38058fdd1acb8
parent16cc2ba71b9f6440805aef7f92ba0f031f79b765
scsi: mpi3mr: Replace deprecated strncpy() with assignments

Really, there's no bug with the current code. Let's just ditch strncpy()
all together.

We can just copy the const strings instead of reserving room on the stack.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Justin Stitt <justinstitt@google.com>
Link: https://lore.kernel.org/r/20240305-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v3-1-5b78a13ff984@google.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpi3mr/mpi3mr_fw.c