summary refs log tree commit diff
path: root/misc/error.c
diff options
context:
space:
mode:
authorOndřej Bílka <neleai@seznam.cz>2013-10-14 17:15:08 +0200
committerOndřej Bílka <neleai@seznam.cz>2013-10-14 17:15:48 +0200
commit17c48a60b8f51e627fc1a1bc3805a80b7bdf6d8d (patch)
tree34f5acbf55012d7a35bf6cbdb02148a5b359c9c2 /misc/error.c
parentcabba9343c8bd99e4aea66aa1e0ec7d93aa18a7e (diff)
downloadglibc-17c48a60b8f51e627fc1a1bc3805a80b7bdf6d8d.tar.gz
glibc-17c48a60b8f51e627fc1a1bc3805a80b7bdf6d8d.tar.xz
glibc-17c48a60b8f51e627fc1a1bc3805a80b7bdf6d8d.zip
Fix error_tail overflow in allocation calculation.
Diffstat (limited to 'misc/error.c')
-rw-r--r--misc/error.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc/error.c b/misc/error.c
index c8e62cf9b4..408a1ab25e 100644
--- a/misc/error.c
+++ b/misc/error.c
@@ -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;