summaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorMarkus Armbruster2008-04-30 09:54:52 +0200
committerLinus Torvalds2008-04-30 17:29:52 +0200
commitf735295b14ae073a8302d7b1da894bc597724557 (patch)
tree844555a3a768ad6eef3d6884b6b114cebefa0ec4 /kernel/printk.c
parentBasic braille screen reader support (diff)
downloadkernel-qcow2-linux-f735295b14ae073a8302d7b1da894bc597724557.tar.gz
kernel-qcow2-linux-f735295b14ae073a8302d7b1da894bc597724557.tar.xz
kernel-qcow2-linux-f735295b14ae073a8302d7b1da894bc597724557.zip
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 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
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;