aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2008-04-30 03:54:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:52 -0400
commitf735295b14ae073a8302d7b1da894bc597724557 (patch)
tree844555a3a768ad6eef3d6884b6b114cebefa0ec4
parentf7511d5f66f01fc451747b24e79f3ada7a3af9af (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>
-rw-r--r--kernel/printk.c2
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;