Commit a16ac6ca authored by Thorsten Blum's avatar Thorsten Blum Committed by Greg Ungerer
Browse files

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: default avatarThorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: default avatarGreg Ungerer <gerg@kernel.org>
parent 590fe2f4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
}