1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

Fix error_tail overflow in allocation calculation.

This commit is contained in:
Ondřej Bílka
2013-10-14 17:15:08 +02:00
parent cabba9343c
commit 17c48a60b8
3 changed files with 11 additions and 6 deletions

View File

@ -165,7 +165,7 @@ error_tail (int status, int errnum, const char *message, va_list args)
if (res != len)
break;
if (__builtin_expect (len >= SIZE_MAX / 2, 0))
if (__builtin_expect (len >= SIZE_MAX / sizeof (wchar_t) / 2, 0))
{
/* This really should not happen if everything is fine. */
res = (size_t) -1;