]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
m68knommu: Replace deprecated strcpy with strscpy in init_ucsimm
authorThorsten Blum <thorsten.blum@linux.dev>
Sun, 18 Jan 2026 17:33:49 +0000 (18:33 +0100)
committerGreg Ungerer <gerg@kernel.org>
Tue, 27 Jan 2026 02:38:52 +0000 (12:38 +1000)
strcpy() has been deprecated [1] because it performs no bounds checking
on the destination buffer, which can lead to buffer overflows. Replace
it with the safer strscpy().

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Greg Ungerer <gerg@kernel.org>
arch/m68k/68000/ucsimm.c

index c54fde75eae8efcdf7474ba58dbd3eb400fb8fd7..6b84e826040f452f9b514e42a6cb823f0fa7445b 100644 (file)
@@ -9,6 +9,7 @@
  * for more details.
  */
 #include <linux/init.h>
+#include <linux/string.h>
 #include <asm/bootstd.h>
 #include <asm/machdep.h>
 #include <asm/MC68VZ328.h>
@@ -31,7 +32,7 @@ void __init init_ucsimm(char *command, int size)
        pr_info("uCsimm/uCdimm hwaddr %pM\n", p);
        p = getbenv("APPEND");
        if (p)
-               strcpy(p, command);
+               strscpy(p, command, size);
        else
                command[0] = 0;
 }