summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2017-11-01 02:11:30 -0400
committerJay Satiro <raysatiro@yahoo.com>2017-11-01 02:11:30 -0400
commitb8bd6dc110fbcae20e0902bead097a40ed88e01a (patch)
tree653b0ad1151b674a67ce4d6b821da6f0b404eabb
parentfa394c8c2e39ea327d668f14353b32580e821b1c (diff)
downloadcurl-b8bd6dc110fbcae20e0902bead097a40ed88e01a.tar.gz
url: fix CURLOPT_POSTFIELDSIZE arg value check to allow -1
.. also add same arg value check to CURLOPT_POSTFIELDSIZE_LARGE. Prior to this change since f121575 (7.56.1+) CURLOPT_POSTFIELDSIZE erroneously rejected -1 value with CURLE_BAD_FUNCTION_ARGUMENT. Bug: https://curl.haxx.se/mail/lib-2017-11/0000.html Reported-by: Andrew Lambert
-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]) {