Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFC: nxp-nci: Replace strcpy() with strscpy()

Replace strcpy() with strscpy() which limits the copy to the size of
the destination buffer. Since fw_info->name is an array, the
two-argument variant of strscpy() is used - the compiler deduces
the buffer size automatically.

This is a defensive cleanup replacing the deprecated strcpy()
with the preferred strscpy().

Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260301135633.214497-1-tomasz.unger@yahoo.pl
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Tomasz Unger and committed by
Jakub Kicinski
66e807f9 e63f5918

+1 -1
+1 -1
drivers/nfc/nxp-nci/firmware.c
··· 211 211 goto fw_download_exit; 212 212 } 213 213 214 - strcpy(fw_info->name, firmware_name); 214 + strscpy(fw_info->name, firmware_name); 215 215 216 216 r = request_firmware(&fw_info->fw, firmware_name, 217 217 ndev->nfc_dev->dev.parent);