From fac054e086ae3d1cc1024093c68962207bcb9c34 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Thu, 7 Feb 2008 07:06:49 +0000 Subject: Fix stack overflow in _ppfs_parsespec --- libc/stdio/_vfprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/stdio/_vfprintf.c b/libc/stdio/_vfprintf.c index 30ce7caef..fd2975aa3 100644 --- a/libc/stdio/_vfprintf.c +++ b/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__ */ -- cgit v1.2.3