Skip to content

Commit a16ac6c

Browse files
tobluxGreg Ungerer
authored andcommitted
m68knommu: Replace deprecated strcpy with strscpy in init_ucsimm
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 [1] Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Greg Ungerer <gerg@kernel.org>
1 parent 590fe2f commit a16ac6c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/m68k/68000/ucsimm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* for more details.
1010
*/
1111
#include <linux/init.h>
12+
#include <linux/string.h>
1213
#include <asm/bootstd.h>
1314
#include <asm/machdep.h>
1415
#include <asm/MC68VZ328.h>
@@ -31,7 +32,7 @@ void __init init_ucsimm(char *command, int size)
3132
pr_info("uCsimm/uCdimm hwaddr %pM\n", p);
3233
p = getbenv("APPEND");
3334
if (p)
34-
strcpy(p, command);
35+
strscpy(p, command, size);
3536
else
3637
command[0] = 0;
3738
}

0 commit comments

Comments
 (0)