diff options
author | Yang Tse <yangsita@gmail.com> | 2007-10-16 23:32:02 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2007-10-16 23:32:02 +0000 |
commit | c6ef31955a3990f28a009fd0a63127fada7bbffb (patch) | |
tree | cd381f5bdb5d0584e3439c5253236f9b439b5333 /lib | |
parent | 92aaff009d0a2e5ade970fb3700ca2d516ff12ec (diff) |
ANSI C compliant overflow check
Diffstat (limited to 'lib')
-rw-r--r-- | lib/url.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1047,10 +1047,8 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, * Check that request length does not overflow the size_t type. */ - if ((curl_off_t) ((size_t) data->set.postfieldsize) != - data->set.postfieldsize || - data->set.postfieldsize < (curl_off_t) 0 || - (size_t) data->set.postfieldsize < (size_t) 0) + if ((data->set.postfieldsize < 0) || + (data->set.postfieldsize > (curl_off_t)((size_t)-1))) result = CURLE_OUT_OF_MEMORY; else { char * p; |