Skip to content

Commit 70570a6

Browse files
committed
Merge tag 'nios2-v5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2
Pull nios2 fix from Ley Foon Tan: "Make sure the command line buffer is NUL-terminated" * tag 'nios2-v5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2: nios2: force the string buffer NULL-terminated
2 parents 8bbe0de + 91d99a7 commit 70570a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/nios2/kernel/setup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,18 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6,
123123
dtb_passed = r6;
124124

125125
if (r7)
126-
strncpy(cmdline_passed, (char *)r7, COMMAND_LINE_SIZE);
126+
strlcpy(cmdline_passed, (char *)r7, COMMAND_LINE_SIZE);
127127
}
128128
#endif
129129

130130
early_init_devtree((void *)dtb_passed);
131131

132132
#ifndef CONFIG_CMDLINE_FORCE
133133
if (cmdline_passed[0])
134-
strncpy(boot_command_line, cmdline_passed, COMMAND_LINE_SIZE);
134+
strlcpy(boot_command_line, cmdline_passed, COMMAND_LINE_SIZE);
135135
#ifdef CONFIG_NIOS2_CMDLINE_IGNORE_DTB
136136
else
137-
strncpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
137+
strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
138138
#endif
139139
#endif
140140

0 commit comments

Comments
 (0)