From: Chen Gang Date: Fri, 7 Jun 2013 00:08:36 +0000 (+1000) Subject: arch/frv/kernel/traps.c: using vsnprintf() instead of vsprintf() X-Git-Tag: next-20130607~2^2~263 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e1eac01c8b4578c69614b2d1270b8a9dc0773f49;p=karo-tx-linux.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 --- 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();