* stdio-common/vfprintf.c (vfprintf): Correct overflow test.

This commit is contained in:
Ulrich Drepper 2008-03-30 05:39:35 +00:00
parent e8a3212650
commit 43f6bec195
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,7 @@
2008-03-29 Ulrich Drepper <drepper@redhat.com>
* stdio-common/vfprintf.c (vfprintf): Correct overflow test.
[BZ #5939]
* sysdeps/posix/tempname.c (__gen_tempname): Correct flag selection.

View File

@ -1513,7 +1513,8 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
if (prec > width
&& prec + 32 > (int)(sizeof (work_buffer) / sizeof (work_buffer[0])))
{
if (__builtin_expect (prec > ~((size_t) 0) - 31, 0))
if (__builtin_expect (prec > ~((size_t) 0) / sizeof (CHAR_T) - 31,
0))
{
done = -1;
goto all_done;