mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
printk: don't read beyond string arguments' terminating zero
Fix update_console_cmdline() not to to read beyond the terminating zero of its name argument. Signed-off-by: Markus Armbruster <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
f7511d5f66
commit
f735295b14
1 changed files with 1 additions and 1 deletions
|
|
@ -921,7 +921,7 @@ int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, cha
|
|||
if (strcmp(console_cmdline[i].name, name) == 0 &&
|
||||
console_cmdline[i].index == idx) {
|
||||
c = &console_cmdline[i];
|
||||
memcpy(c->name, name_new, sizeof(c->name));
|
||||
strlcpy(c->name, name_new, sizeof(c->name));
|
||||
c->name[sizeof(c->name) - 1] = 0;
|
||||
c->options = options;
|
||||
c->index = idx_new;
|
||||
|
|
|
|||
Loading…
Reference in a new issue