aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-10-17 18:06:32 +0000
committerYang Tse <yangsita@gmail.com>2007-10-17 18:06:32 +0000
commite7387f7557ae3bde7e4b75befedd88ee04913b49 (patch)
tree2ac40fae574f103d4ec8827941c3ff348fb72740 /lib
parent582bad89ef8dea6428b97ddb2ca7bf8e7c62d88b (diff)
Fix overflow detection, thanks to Patrick Monnerat detecting test
failure condition: http://curl.haxx.se/mail/lib-2007-10/0152.html
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index eab1d6d55..35d2d046b 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1039,8 +1039,9 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
* Check that request length does not overflow the size_t type.
*/
- if ((data->set.postfieldsize < 0) ||
- (data->set.postfieldsize > (curl_off_t)((size_t)-1)))
+ if ((sizeof(curl_off_t) != sizeof(size_t)) &&
+ ((data->set.postfieldsize < 0) ||
+ (data->set.postfieldsize > (curl_off_t)((size_t)-1))))
result = CURLE_OUT_OF_MEMORY;
else {
char * p;