aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/url.c b/lib/url.c
index 461bfe36b..e605fdcd0 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -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;