summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Mahdi Anbaraki <m.mahdianbaraki@gmail.com>2025-04-03 21:41:59 +0330
committerGreg Ungerer <gerg@kernel.org>2025-05-19 08:54:30 +1000
commit245bb7b95aff5f20884c0b635eacb96645eadc84 (patch)
tree55051d697e0070b883d6c55d55bb3e35f466f689
parent0c4aba403f4f294c15e2bbc8e1164aa68bc233bd (diff)
m68k/kernel: replace strncpy() with strscpy()
Swapped out strncpy() for strscpy() in parse_uboot_commandline() while copying to commandp. strscpy() makes sure the string is properly null- terminated and gives a more useful return value so it's just a safer choice overall. Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Mohammad Mahdi Anbaraki <m.mahdianbaraki@gmail.com> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
-rw-r--r--arch/m68k/kernel/uboot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/m68k/kernel/uboot.c b/arch/m68k/kernel/uboot.c
index 5e52ea150d5c..fa7c279ead5d 100644
--- a/arch/m68k/kernel/uboot.c
+++ b/arch/m68k/kernel/uboot.c
@@ -73,7 +73,7 @@ static void __init parse_uboot_commandline(char *commandp, int size)
uboot_cmd_end = sp[5];
if (uboot_cmd_start && uboot_cmd_end)
- strncpy(commandp, (const char *)uboot_cmd_start, size);
+ strscpy(commandp, (const char *)uboot_cmd_start, size);
#if defined(CONFIG_BLK_DEV_INITRD)
uboot_initrd_start = sp[2];