From 6bc0411d201d76286005157c98dea0c7dfebb0ca Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Wed, 19 Jun 2013 10:07:05 +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