* [PATCH] m68k: atari: Use strscpy() in atari_switches_setup()
@ 2026-11-06 23:31 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-11-06 23:31 UTC (permalink / raw)
To: Geert Uytterhoeven, Michael Schmitz, Miro Kropacek
Cc: Thorsten Blum, linux-m68k, linux-kernel
strcpy() has been deprecated [1] because it performs no bounds checking
on the destination buffer, which can lead to buffer overflows.
While the current code works correctly, replace strcpy() with strscpy()
to bound the copy to the size of the switches buffer.
Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1]
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
arch/m68k/atari/config.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index b82bbf93d8e7..09f4219faed6 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -35,4 +35,5 @@
#include <linux/usb/isp116x.h>
#include <linux/module.h>
+#include <linux/string.h>
#include <net/ethoc.h>
@@ -154,5 +155,5 @@ static int __init atari_switches_setup(char *str)
/* copy string to local array, strsep works destructively... */
- strcpy(switches, str);
+ strscpy(switches, str);
atari_switches = 0;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-06 23:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 23:31 [PATCH] m68k: atari: Use strscpy() in atari_switches_setup() Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®