Skip to contentSkip to conversation

arm: early_printk: do bound check independent of @n

PATCH New Arjun Sreedharan 1 participant 1 message Nov 21, 2014 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: early_printk: do bound check independent of @n

---
 arch/arm/kernel/early_printk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/early_printk.c +1 -1
index 4307653..9e05f8a 100644
@@ -16,7 +16,7 @@ extern void printch(int);
 
 static void early_write(const char *s, unsigned n)
 {
-	while (n-- > 0) {
+	while (*s && n-- > 0) {
 		if (*s == '\n')
 			printch('\r');
 		printch(*s);
Signature · 1 line
1.7.11.7