]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
MIPS: Replace strcpy() with strscpy() in vpe_elfload()
authorThorsten Blum <thorsten.blum@linux.dev>
Fri, 25 Apr 2025 07:46:48 +0000 (09:46 +0200)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Sun, 27 Apr 2025 07:47:52 +0000 (09:47 +0200)
strcpy() is deprecated; use strscpy() instead.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/kernel/vpe.c

index 737d0d4fdcd35161bfd8865ef5de057a7c3da14a..2b67c44adab9b9cf9b28b0a2e99edae5d7b2b58e 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/vmalloc.h>
 #include <linux/elf.h>
 #include <linux/seq_file.h>
+#include <linux/string.h>
 #include <linux/syscalls.h>
 #include <linux/moduleloader.h>
 #include <linux/interrupt.h>
@@ -582,7 +583,7 @@ static int vpe_elfload(struct vpe *v)
        struct module mod; /* so we can re-use the relocations code */
 
        memset(&mod, 0, sizeof(struct module));
-       strcpy(mod.name, "VPE loader");
+       strscpy(mod.name, "VPE loader");
 
        hdr = (Elf_Ehdr *) v->pbuffer;
        len = v->plen;