From: Tomasz Unger Date: Mon, 2 Mar 2026 10:09:08 +0000 (+0100) Subject: NFC: s3fwrn5: Replace strcpy() with strscpy() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ce185c7e00dbddfdea026acd5dcf7b122af3db0;p=thirdparty%2Fkernel%2Flinux.git NFC: s3fwrn5: Replace strcpy() with strscpy() Replace strcpy() with strscpy() which limits the copy to the size of the destination buffer. Since fw_info->fw_name is an array with a fixed, declared size, 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: Krzysztof Kozlowski Link: https://patch.msgid.link/20260302100908.26399-1-tomasz.unger@yahoo.pl Signed-off-by: Jakub Kicinski --- diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c index 64d61b2a715ae..9145deec7f6c1 100644 --- a/drivers/nfc/s3fwrn5/firmware.c +++ b/drivers/nfc/s3fwrn5/firmware.c @@ -454,7 +454,7 @@ void s3fwrn5_fw_init(struct s3fwrn5_fw_info *fw_info, const char *fw_name) fw_info->parity = 0x00; fw_info->rsp = NULL; fw_info->fw.fw = NULL; - strcpy(fw_info->fw_name, fw_name); + strscpy(fw_info->fw_name, fw_name); init_completion(&fw_info->completion); }