Skip to contentSkip to conversation

ARM: plat-samsung: using vsnprintf instead of vsprintf for the limit buffer length 256

PATCH New Chen Gang 2 participants 2 messages Jan 22, 2013 – Jan 25, 2013

Subsystems (3)
lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH v2 1/1 ARM: plat-samsung: using vsnprintf instead of vsprintf for the limit buffer length 256

the buff is 256 limited, so need use vsnprintf instead of vsprintf

---
 arch/arm/plat-samsung/pm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/plat-samsung/pm.c +1 -1
index 1507028..d896add 100644
@@ -51,7 +51,7 @@ void s3c_pm_dbg(const char *fmt, ...)
 	char buff[256];
 
 	va_start(va, fmt);
-	vsprintf(buff, fmt, va);
+	vsnprintf(buff, sizeof(buff), fmt, va);
 	va_end(va);
 
 	printascii(buff);
Signature · 1 line
1.7.10.4
Applied
#1 lore raw

PATCH v2 1/1 ARM: plat-samsung: using vsnprintf instead of vsprintf for the limit buffer length 256

Quoted 24 lines · Chen Gang

the buff is 256 limited, so need use vsnprintf instead of vsprintf

---
 arch/arm/plat-samsung/pm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/plat-samsung/pm.c +1 -2
index 1507028..d896add 100644
@@ -51,7 +51,7 @@ void s3c_pm_dbg(const char *fmt, ...)
 	char buff[256];
 
 	va_start(va, fmt);
-	vsprintf(buff, fmt, va);
+	vsnprintf(buff, sizeof(buff), fmt, va);
 	va_end(va);
 
 	printascii(buff);
--
Quoted 1 line

1.7.10.4

Applied, thanks.

- Kukjin