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: nfcmrvl: Replace strcpy() with strscpy()

Replace strcpy() with strscpy() which limits the copy to the size of
the destination buffer. Since fw_dnld->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/20260301144345.218628-1-tomasz.unger@yahoo.pl
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Tomasz Unger and committed by
Jakub Kicinski
c49a9eb6 66e807f9

+1 -1
+1 -1
drivers/nfc/nfcmrvl/fw_dnld.c
··· 492 492 if (!firmware_name || !firmware_name[0]) 493 493 return -EINVAL; 494 494 495 - strcpy(fw_dnld->name, firmware_name); 495 + strscpy(fw_dnld->name, firmware_name); 496 496 497 497 /* 498 498 * Retrieve FW binary file and parse it to initialize FW download