public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v1] NFC: nfcmrvl: Replace strcpy() with strscpy()
       [not found] <20260301144345.218628-1-tomasz.unger.ref@yahoo.pl>
@ 2026-03-01 14:43 ` tomasz.unger
  2026-03-03 20:56   ` Simon Horman
  2026-03-04  1:30   ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: tomasz.unger @ 2026-03-01 14:43 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, Tomasz Unger

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

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 <tomasz.unger@yahoo.pl>
---

Testing:
- checkpatch.pl: 0 errors, 0 warnings
- make M=drivers/nfc/nfcmrvl/: compiled successfully, 0 errors, 0 warnings
- Module loaded successfully in QEMU (x86_64) with buildroot:
  modprobe nfcmrvl - no errors, confirmed via lsmod

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

diff --git a/drivers/nfc/nfcmrvl/fw_dnld.c b/drivers/nfc/nfcmrvl/fw_dnld.c
index a9b03dcc4100..2b8f401d8fd7 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
-- 
2.53.0


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

* Re: [PATCH net-next v1] NFC: nfcmrvl: Replace strcpy() with strscpy()
  2026-03-01 14:43 ` [PATCH net-next v1] NFC: nfcmrvl: Replace strcpy() with strscpy() tomasz.unger
@ 2026-03-03 20:56   ` Simon Horman
  2026-03-04  1:30   ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2026-03-03 20:56 UTC (permalink / raw)
  To: tomasz.unger; +Cc: netdev, linux-kernel

On Sun, Mar 01, 2026 at 03:43:45PM +0100, tomasz.unger@yahoo.pl 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_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 <tomasz.unger@yahoo.pl>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [PATCH net-next v1] NFC: nfcmrvl: Replace strcpy() with strscpy()
  2026-03-01 14:43 ` [PATCH net-next v1] NFC: nfcmrvl: Replace strcpy() with strscpy() tomasz.unger
  2026-03-03 20:56   ` Simon Horman
@ 2026-03-04  1:30   ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-04  1:30 UTC (permalink / raw)
  To: None; +Cc: netdev, linux-kernel

Hello:

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

On Sun,  1 Mar 2026 15:43:45 +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_dnld->name is an array, the
> two-argument variant of strscpy() is used - the compiler deduces
> the buffer size automatically.
> 
> [...]

Here is the summary with links:
  - [net-next,v1] NFC: nfcmrvl: Replace strcpy() with strscpy()
    https://git.kernel.org/netdev/net-next/c/c49a9eb650d5

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] 3+ messages in thread

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260301144345.218628-1-tomasz.unger.ref@yahoo.pl>
2026-03-01 14:43 ` [PATCH net-next v1] NFC: nfcmrvl: Replace strcpy() with strscpy() tomasz.unger
2026-03-03 20:56   ` Simon Horman
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