[PATCH] m68k: atari: Use strscpy() in atari_switches_setup()

From: Thorsten Blum

Date: Fri Nov 06 2026 - 18:32:09 EST


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@xxxxxxxxxx>
---
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;