mirror of
https://github.com/curl/curl.git
synced 2026-05-30 19:47:30 +03:00
vauth/cleartext: fix theoretical integer overflow
Fix theoretical integer overflow in Curl_auth_create_plain_message. The security impact of the overflow was discussed on hackerone. We agreed this is more of a theoretical vulnerability, as the integer overflow would only be triggerable on systems using 32-bits size_t with over 4GB of available memory space for the process. Closes #5391
This commit is contained in:
parent
f9983a6f9e
commit
8e762199b0
1 changed files with 2 additions and 1 deletions
|
|
@ -81,7 +81,8 @@ CURLcode Curl_auth_create_plain_message(struct Curl_easy *data,
|
|||
plen = strlen(passwd);
|
||||
|
||||
/* Compute binary message length. Check for overflows. */
|
||||
if(((zlen + clen) > SIZE_T_MAX/4) || (plen > (SIZE_T_MAX/2 - 2)))
|
||||
if((zlen > SIZE_T_MAX/4) || (clen > SIZE_T_MAX/4) ||
|
||||
(plen > (SIZE_T_MAX/2 - 2)))
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
plainlen = zlen + clen + plen + 2;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue