mirror of
https://github.com/torvalds/linux.git
synced 2026-05-13 00:28:54 +02:00
Replace strcpy() with strscpy() which limits the copy to the size of the destination buffer. Since phy->firmware_name is an array, the two-argument variant of strscpy() is used - the compiler deduces the buffer size automatically. This is a defensive cleanup. As pointed out by Jakub Kicinski <kuba@kernel.org>, firmware_name is already bounded to NFC_FIRMWARE_NAME_MAXSIZE via nla_strscpy() in net/nfc/netlink.c before reaching this driver, so no actual buffer overflow is possible. Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260301121254.174354-1-tomasz.unger@yahoo.pl Signed-off-by: Jakub Kicinski <kuba@kernel.org> |
||
|---|---|---|
| .. | ||
| i2c.c | ||
| Kconfig | ||
| Makefile | ||
| mei.c | ||
| pn544.c | ||
| pn544.h | ||