From bb7420180497f6087cd2d894253beb2532a0569e Mon Sep 17 00:00:00 2001 From: Paul Dreik Date: Mon, 23 Sep 2019 13:10:12 +0200 Subject: [PATCH] doh: return early if there is no time left Closes #4406 --- lib/doh.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/doh.c b/lib/doh.c index 5a76d6d87..05a6cc235 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -240,7 +240,10 @@ static CURLcode dohprobe(struct Curl_easy *data, } timeout_ms = Curl_timeleft(data, NULL, TRUE); - + if(timeout_ms <= 0) { + result = CURLE_OPERATION_TIMEDOUT; + goto error; + } /* Curl_open() is the internal version of curl_easy_init() */ result = Curl_open(&doh); if(!result) {