Skip to contentSkip to conversation

arch: frv: kernel: using vsnprintf() instead of vsprintf()

PATCH New Chen Gang 1 participant 1 message May 27, 2013 Generic include/asm header files

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 arch: frv: kernel: 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'.

---
 arch/frv/kernel/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/frv/kernel/traps.c +1 -1
index 4bff48c..a6d105d 100644
@@ -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();
Signature · 1 line
1.7.7.6