aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/url.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/url.c b/lib/url.c
index 5a11e423b..dec402c1d 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1143,7 +1143,7 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
* figure it out. Enables binary posts.
*/
bigsize = va_arg(param, long);
- if(bigsize < 0)
+ if(bigsize < -1)
return CURLE_BAD_FUNCTION_ARGUMENT;
if(data->set.postfieldsize < bigsize &&
@@ -1162,6 +1162,8 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
* figure it out. Enables binary posts.
*/
bigsize = va_arg(param, curl_off_t);
+ if(bigsize < -1)
+ return CURLE_BAD_FUNCTION_ARGUMENT;
if(data->set.postfieldsize < bigsize &&
data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) {