public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v3] NFC: s3fwrn5: Replace strcpy() with strscpy()
       [not found] <20260302100908.26399-1-tomasz.unger.ref@yahoo.pl>
@ 2026-03-02 10:09 ` tomasz.unger
  2026-03-04  1:30   ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: tomasz.unger @ 2026-03-02 10:09 UTC (permalink / raw)
  To: krzk; +Cc: netdev, linux-kernel, Tomasz Unger, Krzysztof Kozlowski

From: Tomasz Unger <tomasz.unger@yahoo.pl>

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 <tomasz.unger@yahoo.pl>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
Changes since v2:
- Fixed commit message line wrapping (Krzysztof Kozlowski)
- Added Reviewed-by tag from Krzysztof Kozlowski

Changes since v1:
- Clarified commit message: fw_info->fw_name described as
  "an array with a fixed, declared size" as requested by
  Krzysztof Kozlowski <krzk@kernel.org>

 drivers/nfc/s3fwrn5/firmware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c
index 64d61b2a715a..9145deec7f6c 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);
 }
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next v3] NFC: s3fwrn5: Replace strcpy() with strscpy()
  2026-03-02 10:09 ` [PATCH net-next v3] NFC: s3fwrn5: Replace strcpy() with strscpy() tomasz.unger
@ 2026-03-04  1:30   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-04  1:30 UTC (permalink / raw)
  To: None; +Cc: krzk, netdev, linux-kernel, krzysztof.kozlowski

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  2 Mar 2026 11:09:08 +0100 you wrote:
> From: Tomasz Unger <tomasz.unger@yahoo.pl>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next,v3] NFC: s3fwrn5: Replace strcpy() with strscpy()
    https://git.kernel.org/netdev/net-next/c/8ce185c7e00d

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-04  1:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260302100908.26399-1-tomasz.unger.ref@yahoo.pl>
2026-03-02 10:09 ` [PATCH net-next v3] NFC: s3fwrn5: Replace strcpy() with strscpy() tomasz.unger
2026-03-04  1:30   ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox