1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

* 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

@@ -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;