Skip to content

Commit 245bb7b

Browse files
binophismGreg Ungerer
authored andcommitted
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: KSPP#90 Signed-off-by: Mohammad Mahdi Anbaraki <[email protected]> Signed-off-by: Greg Ungerer <[email protected]>
1 parent 0c4aba4 commit 245bb7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/m68k/kernel/uboot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static void __init parse_uboot_commandline(char *commandp, int size)
7373
uboot_cmd_end = sp[5];
7474

7575
if (uboot_cmd_start && uboot_cmd_end)
76-
strncpy(commandp, (const char *)uboot_cmd_start, size);
76+
strscpy(commandp, (const char *)uboot_cmd_start, size);
7777

7878
#if defined(CONFIG_BLK_DEV_INITRD)
7979
uboot_initrd_start = sp[2];

0 commit comments

Comments
 (0)