From: Markus Armbruster Date: Wed, 30 Apr 2008 07:54:52 +0000 (-0700) Subject: printk: don't read beyond string arguments' terminating zero X-Git-Tag: v2.6.26-rc1~133 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f735295b14ae073a8302d7b1da894bc597724557;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/printk.c b/kernel/printk.c index e61346faf6a..8fb01c32aa3 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 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;