diff options
author | Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> | 2008-12-19 13:23:03 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-19 16:52:47 -0500 |
commit | 26cc271db798cf211d35967cbfbb53e997126b84 (patch) | |
tree | c4131ca7cdf2cfbc90c421b82e2b3b88b8927e6a /kernel/printk.c | |
parent | 929096fe9ff1f4b3645cf3919527ab47e8d5e17c (diff) |
printk: fix discarding message when recursion_bug
Impact: fix truncated recursion bug message printout
When recursion_bug is true, kernel discards original message because printk_buf
contains recursion_bug_msg with NULL terminator. The sizeof(recursion_bug_msg)
makes this, use strlen() to get correct length without NULL terminator.
Reported-by: Toshikazu Nakayama <nakayama.ts@ncos.nec.co.jp>
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index f492f1583d77..e651ab05655f 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -662,7 +662,7 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
662 | if (recursion_bug) { | 662 | if (recursion_bug) { |
663 | recursion_bug = 0; | 663 | recursion_bug = 0; |
664 | strcpy(printk_buf, recursion_bug_msg); | 664 | strcpy(printk_buf, recursion_bug_msg); |
665 | printed_len = sizeof(recursion_bug_msg); | 665 | printed_len = strlen(recursion_bug_msg); |
666 | } | 666 | } |
667 | /* Emit the output into the temporary buffer */ | 667 | /* Emit the output into the temporary buffer */ |
668 | printed_len += vscnprintf(printk_buf + printed_len, | 668 | printed_len += vscnprintf(printk_buf + printed_len, |