From: Chen Gang Date: Wed, 3 Jul 2013 22:04:52 +0000 (-0700) Subject: arch/frv/kernel/traps.c: using vsnprintf() instead of vsprintf() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=760033c45e8aa13c9e02530da7274edc624c7689;p=linux-beck.git 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 Cc: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/frv/kernel/traps.c b/arch/frv/kernel/traps.c index 4bff48c19d29..a6d105d61b26 100644 --- a/arch/frv/kernel/traps.c +++ b/arch/frv/kernel/traps.c @@ -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();