]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
MIPS: sgi-ip22: Replace deprecated strcpy() in plat_mem_setup()
authorThorsten Blum <thorsten.blum@linux.dev>
Sun, 17 Aug 2025 18:37:11 +0000 (20:37 +0200)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 29 Aug 2025 20:34:29 +0000 (22:34 +0200)
strcpy() is deprecated; use strscpy() instead.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/sgi-ip22/ip22-setup.c

index e06a818fe7928ecf08d28249000513a38ff09c7d..f083b25be13b29c02357e44b065e5441a2ad39f4 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/types.h>
 #include <linux/console.h>
 #include <linux/sched.h>
+#include <linux/string.h>
 #include <linux/tty.h>
 
 #include <asm/addrspace.h>
@@ -65,7 +66,7 @@ void __init plat_mem_setup(void)
                static char options[8] __initdata;
                char *baud = ArcGetEnvironmentVariable("dbaud");
                if (baud)
-                       strcpy(options, baud);
+                       strscpy(options, baud);
                add_preferred_console("ttyS", *(ctype + 1) == '2' ? 1 : 0,
                                      baud ? options : NULL);
        } else if (!ctype || *ctype != 'g') {