Skip to content

Commit

Permalink
printk: don't read beyond string arguments' terminating zero
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Markus Armbruster authored and torvalds committed Apr 30, 2008
1 parent f7511d5 commit f735295
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f735295

Please sign in to comment.