Browse Source

Fix stack overflow in _ppfs_parsespec

Carmelo Amoroso 17 years ago
parent
commit
fac054e086
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libc/stdio/_vfprintf.c

+ 1 - 1
libc/stdio/_vfprintf.c

@@ -898,7 +898,7 @@ int attribute_hidden _ppfs_parsespec(ppfs_t *ppfs)
 				) {
 				return -1;
 			}
-		} while (buf[i++]);
+		} while (buf[i++] && (i < sizeof(buf)));
 		buf[sizeof(buf)-1] = 0;
 	}
 #else  /* __UCLIBC_HAS_WCHAR__ */