Commit 70570a64 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 8bbe0dec 91d99a72
...@@ -123,7 +123,7 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6, ...@@ -123,7 +123,7 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6,
dtb_passed = r6; dtb_passed = r6;
if (r7) if (r7)
strncpy(cmdline_passed, (char *)r7, COMMAND_LINE_SIZE); strlcpy(cmdline_passed, (char *)r7, COMMAND_LINE_SIZE);
} }
#endif #endif
...@@ -131,10 +131,10 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6, ...@@ -131,10 +131,10 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6,
#ifndef CONFIG_CMDLINE_FORCE #ifndef CONFIG_CMDLINE_FORCE
if (cmdline_passed[0]) if (cmdline_passed[0])
strncpy(boot_command_line, cmdline_passed, COMMAND_LINE_SIZE); strlcpy(boot_command_line, cmdline_passed, COMMAND_LINE_SIZE);
#ifdef CONFIG_NIOS2_CMDLINE_IGNORE_DTB #ifdef CONFIG_NIOS2_CMDLINE_IGNORE_DTB
else else
strncpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
#endif #endif
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment