From 17c48a60b8f51e627fc1a1bc3805a80b7bdf6d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20B=C3=ADlka?= Date: Mon, 14 Oct 2013 17:15:08 +0200 Subject: Fix error_tail overflow in allocation calculation. --- misc/error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'misc') 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; -- cgit v1.2.3