From: Daniel Stenberg Date: Mon, 4 Jul 2022 17:28:49 +0000 (+0200) Subject: urldata: store dns cache timeout in an int X-Git-Tag: curl-7_85_0~199 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccc8092b053a0e83cb95af154e2580b9644a9a1a;p=thirdparty%2Fcurl.git urldata: store dns cache timeout in an int 68 years ought to be enough for most. Closes #9097 --- diff --git a/lib/setopt.c b/lib/setopt.c index dc6bc2a09c..0ee2609ee2 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -246,7 +246,10 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) arg = va_arg(param, long); if(arg < -1) return CURLE_BAD_FUNCTION_ARGUMENT; - data->set.dns_cache_timeout = arg; + else if(arg > INT_MAX) + arg = INT_MAX; + + data->set.dns_cache_timeout = (int)arg; break; case CURLOPT_DNS_USE_GLOBAL_CACHE: /* deprecated */ diff --git a/lib/urldata.h b/lib/urldata.h index e815e83166..6523d74612 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -1743,7 +1743,7 @@ struct UserDefined { struct ssl_config_data proxy_ssl; /* user defined SSL stuff for proxy */ #endif struct ssl_general_config general_ssl; /* general user defined SSL stuff */ - long dns_cache_timeout; /* DNS cache timeout */ + int dns_cache_timeout; /* DNS cache timeout (seconds) */ long buffer_size; /* size of receive buffer to use */ unsigned int upload_buffer_size; /* size of upload buffer to use, keep it >= CURL_MAX_WRITE_SIZE */