diff options
author | Markus Armbruster <armbru@redhat.com> | 2008-04-30 03:54:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:52 -0400 |
commit | f735295b14ae073a8302d7b1da894bc597724557 (patch) | |
tree | 844555a3a768ad6eef3d6884b6b114cebefa0ec4 /kernel/printk.c | |
parent | f7511d5f66f01fc451747b24e79f3ada7a3af9af (diff) |
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 <armbru@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index e61346faf6a5..8fb01c32aa3b 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -921,7 +921,7 @@ int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, cha | |||
921 | if (strcmp(console_cmdline[i].name, name) == 0 && | 921 | if (strcmp(console_cmdline[i].name, name) == 0 && |
922 | console_cmdline[i].index == idx) { | 922 | console_cmdline[i].index == idx) { |
923 | c = &console_cmdline[i]; | 923 | c = &console_cmdline[i]; |
924 | memcpy(c->name, name_new, sizeof(c->name)); | 924 | strlcpy(c->name, name_new, sizeof(c->name)); |
925 | c->name[sizeof(c->name) - 1] = 0; | 925 | c->name[sizeof(c->name) - 1] = 0; |
926 | c->options = options; | 926 | c->options = options; |
927 | c->index = idx_new; | 927 | c->index = idx_new; |