From: Daniel Stenberg Date: Fri, 28 Sep 2018 14:08:16 +0000 (+0200) Subject: Curl_auth_create_plain_message: fix too-large-input-check X-Git-Tag: curl-7_62_0~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3a24d7916b9173c69a3e0ee790102993833d6c5;p=curl Curl_auth_create_plain_message: fix too-large-input-check CVE-2018-16839 Reported-by: Harry Sintonen Bug: https://curl.haxx.se/docs/CVE-2018-16839.html --- diff --git a/lib/vauth/cleartext.c b/lib/vauth/cleartext.c index a10edbdc7..be6d6111e 100644 --- a/lib/vauth/cleartext.c +++ b/lib/vauth/cleartext.c @@ -74,7 +74,7 @@ CURLcode Curl_auth_create_plain_message(struct Curl_easy *data, plen = strlen(passwdp); /* Compute binary message length. Check for overflows. */ - if((ulen > SIZE_T_MAX/2) || (plen > (SIZE_T_MAX/2 - 2))) + if((ulen > SIZE_T_MAX/4) || (plen > (SIZE_T_MAX/2 - 2))) return CURLE_OUT_OF_MEMORY; plainlen = 2 * ulen + plen + 2;