]> granicus.if.org Git - curl/commitdiff
doh: return early if there is no time left
authorPaul Dreik <github@pauldreik.se>
Mon, 23 Sep 2019 11:10:12 +0000 (13:10 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 23 Sep 2019 20:38:15 +0000 (22:38 +0200)
Closes #4406

lib/doh.c

index 5a76d6d873dd3a7698be2f0446a25f8ad7f31620..05a6cc2357903ab177b9041d2d3e4af39dd2241c 100644 (file)
--- 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) {