From e1eac01c8b4578c69614b2d1270b8a9dc0773f49 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Fri, 7 Jun 2013 10:08:36 +1000 Subject: [PATCH] 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 --- arch/frv/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); -- 2.39.5