Ver Fonte

Fix stack overflow in _ppfs_parsespec

Carmelo Amoroso há 17 anos atrás
pai
commit
fac054e086
1 ficheiros alterados com 1 adições e 1 exclusões
  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__ */