From: Rich Felker Date: Tue, 5 Apr 2011 13:24:03 +0000 (-0400) Subject: fix overflow in printf %N$ argument handling X-Git-Tag: v0.7.7~25 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2f3d02cd83a46244c3f5a6fec851d7eded1376f4;p=oweals%2Fmusl.git fix overflow in printf %N$ argument handling --- 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;