提交 f735295b 编写于 作者: M Markus Armbruster 提交者: Linus Torvalds

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: NMarkus Armbruster <armbru@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 f7511d5f
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册