mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-15 16:53:54 +08:00
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 <gang.chen@asianux.com> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
519ebea3bf
commit
760033c45e
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user