From: Tomasz Unger Date: Sun, 1 Mar 2026 14:43:45 +0000 (+0100) Subject: NFC: nfcmrvl: Replace strcpy() with strscpy() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c49a9eb650d5b6c9a19901e9055ad4e0a0d2386e;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Simon Horman Link: https://patch.msgid.link/20260301144345.218628-1-tomasz.unger@yahoo.pl Signed-off-by: Jakub Kicinski --- diff --git a/drivers/nfc/nfcmrvl/fw_dnld.c b/drivers/nfc/nfcmrvl/fw_dnld.c index a9b03dcc41006..2b8f401d8fd7a 100644 --- a/drivers/nfc/nfcmrvl/fw_dnld.c +++ b/drivers/nfc/nfcmrvl/fw_dnld.c @@ -492,7 +492,7 @@ int nfcmrvl_fw_dnld_start(struct nci_dev *ndev, const char *firmware_name) if (!firmware_name || !firmware_name[0]) return -EINVAL; - strcpy(fw_dnld->name, firmware_name); + strscpy(fw_dnld->name, firmware_name); /* * Retrieve FW binary file and parse it to initialize FW download