m68k: atari: Use strscpy() in atari_switches_setup()
PATCH 1/1 m68k: atari: Use strscpy() in atari_switches_setup()
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.
Signed-off-by Thorsten Blum <[email protected]>
--- arch/m68k/atari/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/m68k/atari/config.c +2 -1
@@ -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 ;