aboutsummaryrefslogtreecommitdiff
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2008-04-30 00:54:52 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 08:29:52 -0700
commitf735295b14ae073a8302d7b1da894bc597724557 (patch)
tree844555a3a768ad6eef3d6884b6b114cebefa0ec4 /kernel/printk.c
parentf7511d5f66f01fc451747b24e79f3ada7a3af9af (diff)
downloadlinux-f735295b14ae073a8302d7b1da894bc597724557.tar.gz
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.c2
1 files changed, 1 insertions, 1 deletions
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;