Commit 66e807f9 authored by Tomasz Unger's avatar Tomasz Unger Committed by Jakub Kicinski
Browse files

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: default avatarTomasz Unger <tomasz.unger@yahoo.pl>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260301135633.214497-1-tomasz.unger@yahoo.pl


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e63f5918
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ int nxp_nci_fw_download(struct nci_dev *ndev, const char *firmware_name)
		goto fw_download_exit;
	}

	strcpy(fw_info->name, firmware_name);
	strscpy(fw_info->name, firmware_name);

	r = request_firmware(&fw_info->fw, firmware_name,
			     ndev->nfc_dev->dev.parent);