Commit 760033c45e8aa13c9e02530da7274edc624c7689

Authored by Chen Gang
Committed by Linus Torvalds
1 parent 519ebea3bf

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

arch/frv/kernel/traps.c
... ... @@ -523,7 +523,7 @@
523 523 return;
524 524  
525 525 va_start(va, str);
526   - vsprintf(buffer, str, va);
  526 + vsnprintf(buffer, sizeof(buffer), str, va);
527 527 va_end(va);
528 528  
529 529 console_verbose();