]> granicus.if.org Git - curl/commitdiff
url: fix CURLOPT_DNS_CACHE_TIMEOUT arg value check to allow -1
authorJay Satiro <raysatiro@yahoo.com>
Thu, 2 Nov 2017 04:30:28 +0000 (00:30 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 2 Nov 2017 04:30:28 +0000 (00:30 -0400)
Prior to this change since f121575 (7.56.1+) CURLOPT_DNS_CACHE_TIMEOUT
erroneously rejected -1 with CURLE_BAD_FUNCTION_ARGUMENT.

lib/url.c

index c334578eac61cef14547a50dbea6e15ad9f38f93..2e801e58f964c4c99d110f2c5ae15cc54f1faf7f 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -722,7 +722,7 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
   switch(option) {
   case CURLOPT_DNS_CACHE_TIMEOUT:
     arg = va_arg(param, long);
-    if(arg < 0)
+    if(arg < -1)
       return CURLE_BAD_FUNCTION_ARGUMENT;
     data->set.dns_cache_timeout = arg;
     break;