diff options
author | Yang Tse <yangsita@gmail.com> | 2007-10-17 19:29:06 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2007-10-17 19:29:06 +0000 |
commit | 0164f0cf81413948c756e3a7f7003ec5b1094149 (patch) | |
tree | 3497e5d18a400b087bc033f33b08c66d9bfcb953 /lib | |
parent | 420ea83ef39fd479369cf4d58c5d29a5254aabe2 (diff) |
Fix overflow detection, take four. Avoiding zero size malloc.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/url.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1039,8 +1039,8 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, * Check that request length does not overflow the size_t type. */ - if ((sizeof(curl_off_t) != sizeof(size_t)) && - ((data->set.postfieldsize < 0) || + if ((data->set.postfieldsize < 1) || + ((sizeof(curl_off_t) != sizeof(size_t)) && (data->set.postfieldsize > (curl_off_t)((size_t)-1)))) result = CURLE_OUT_OF_MEMORY; else { |