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: Chen Gang <[email protected]>
Cc: David Howells <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Chen Gang 2013-07-03 15:04:52 -07:00 • committed by Linus Torvalds
commit 760033c45e

View file

@ -523,7 +523,7 @@ void die_if_kernel(const char *str, ...)
return;
va_start(va, str);
vsprintf(buffer, str, va);
vsnprintf(buffer, sizeof(buffer), str, va);
va_end(va);
console_verbose();