diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-27 16:02:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-27 16:02:19 -0400 |
commit | 70570a6418be2bd28be30fda700e57a81df7282b (patch) | |
tree | 09b817a3c93a86aa8024e90d714010b4f6233ad5 | |
parent | 8bbe0dec38e147a50e9dd5f585295f7e68e0f2d0 (diff) | |
parent | 91d99a724e9c60e14332c26ab2284bf696b94c8e (diff) |
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
-rw-r--r-- | arch/nios2/kernel/setup.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c index 6bbd4ae2beb0..4cf35b09c0ec 100644 --- a/arch/nios2/kernel/setup.c +++ b/arch/nios2/kernel/setup.c | |||
@@ -123,7 +123,7 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6, | |||
123 | dtb_passed = r6; | 123 | dtb_passed = r6; |
124 | 124 | ||
125 | if (r7) | 125 | if (r7) |
126 | strncpy(cmdline_passed, (char *)r7, COMMAND_LINE_SIZE); | 126 | strlcpy(cmdline_passed, (char *)r7, COMMAND_LINE_SIZE); |
127 | } | 127 | } |
128 | #endif | 128 | #endif |
129 | 129 | ||
@@ -131,10 +131,10 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6, | |||
131 | 131 | ||
132 | #ifndef CONFIG_CMDLINE_FORCE | 132 | #ifndef CONFIG_CMDLINE_FORCE |
133 | if (cmdline_passed[0]) | 133 | if (cmdline_passed[0]) |
134 | strncpy(boot_command_line, cmdline_passed, COMMAND_LINE_SIZE); | 134 | strlcpy(boot_command_line, cmdline_passed, COMMAND_LINE_SIZE); |
135 | #ifdef CONFIG_NIOS2_CMDLINE_IGNORE_DTB | 135 | #ifdef CONFIG_NIOS2_CMDLINE_IGNORE_DTB |
136 | else | 136 | else |
137 | strncpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); | 137 | strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); |
138 | #endif | 138 | #endif |
139 | #endif | 139 | #endif |
140 | 140 | ||