mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
Fix overflow detection, thanks to Patrick Monnerat detecting test
failure condition: http://curl.haxx.se/mail/lib-2007-10/0152.html
This commit is contained in:
parent
582bad89ef
commit
e7387f7557
@ -1039,8 +1039,9 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* Check that request length does not overflow the size_t type.
|
* Check that request length does not overflow the size_t type.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((data->set.postfieldsize < 0) ||
|
if ((sizeof(curl_off_t) != sizeof(size_t)) &&
|
||||||
(data->set.postfieldsize > (curl_off_t)((size_t)-1)))
|
((data->set.postfieldsize < 0) ||
|
||||||
|
(data->set.postfieldsize > (curl_off_t)((size_t)-1))))
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
result = CURLE_OUT_OF_MEMORY;
|
||||||
else {
|
else {
|
||||||
char * p;
|
char * p;
|
||||||
|
Loading…
Reference in New Issue
Block a user