From: Ulrich Drepper Date: Wed, 2 May 2007 08:16:34 +0000 (+0000) Subject: * stdio-common/vfprintf.c (process_string_arg): Use a VLA rather than X-Git-Tag: cvs/fedora-glibc-20070504T0917~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=57433edee3c08b16967487664a28e0ecc99d7f8c;p=thirdparty%2Fglibc.git * stdio-common/vfprintf.c (process_string_arg): Use a VLA rather than fixed length array for ignore. --- diff --git a/ChangeLog b/ChangeLog index d558dede4ec..65290876550 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-05-02 Jakub Jelinek + + * stdio-common/vfprintf.c (process_string_arg): Use a VLA rather than + fixed length array for ignore. + 2007-04-30 Ulrich Drepper [BZ #4438] diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index 31bc5230254..20c07ce73aa 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -1162,7 +1162,8 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) /* In case we have a multibyte character set the \ situation is more complicated. We must not copy \ bytes at the end which form an incomplete character. */\ - wchar_t ignore[1024]; \ + size_t ignore_size = (unsigned) prec > 1024 ? 1024 : prec;\ + wchar_t ignore[ignore_size]; \ const char *str2 = string; \ const char *strend = string + prec; \ if (strend < string) \