summaryrefslogtreecommitdiff
path: root/src/stdio
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-04-05 09:24:03 -0400
committerRich Felker <dalias@aerifal.cx>2011-04-05 09:24:03 -0400
commit2f3d02cd83a46244c3f5a6fec851d7eded1376f4 (patch)
tree44bc11b3cd19ff1cded56ea3b0e02a727ff85514 /src/stdio
parentf9569662c08d371b85c77f025dd5c6e00b4a4c8b (diff)
downloadmusl-2f3d02cd83a46244c3f5a6fec851d7eded1376f4.tar.gz
musl-2f3d02cd83a46244c3f5a6fec851d7eded1376f4.tar.bz2
musl-2f3d02cd83a46244c3f5a6fec851d7eded1376f4.tar.xz
musl-2f3d02cd83a46244c3f5a6fec851d7eded1376f4.zip
fix overflow in printf %N$ argument handling
Diffstat (limited to 'src/stdio')
-rw-r--r--src/stdio/vfprintf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c
index 2245d1da..a8cf41b6 100644
--- a/src/stdio/vfprintf.c
+++ b/src/stdio/vfprintf.c
@@ -633,8 +633,8 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg,
int vfprintf(FILE *f, const char *fmt, va_list ap)
{
va_list ap2;
- int nl_type[NL_ARGMAX] = {0};
- union arg nl_arg[NL_ARGMAX];
+ int nl_type[NL_ARGMAX+1] = {0};
+ union arg nl_arg[NL_ARGMAX+1];
unsigned char internal_buf[80], *saved_buf = 0;
int ret;