Commit 760033c4 authored by Chen Gang's avatar Chen Gang Committed by Linus Torvalds

arch/frv/kernel/traps.c: using vsnprintf() instead of vsprintf()

Since die_if_kernel() is an extern common used function, better always
check the buffer length to avoid memory overflow by a long 'str'.
Signed-off-by: default avatarChen Gang <gang.chen@asianux.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 519ebea3
...@@ -523,7 +523,7 @@ void die_if_kernel(const char *str, ...) ...@@ -523,7 +523,7 @@ void die_if_kernel(const char *str, ...)
return; return;
va_start(va, str); va_start(va, str);
vsprintf(buffer, str, va); vsnprintf(buffer, sizeof(buffer), str, va);
va_end(va); va_end(va);
console_verbose(); console_verbose();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment