]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
multi_runsingle: bail out early on data->conn == NULL
authorDaniel Stenberg <daniel@haxx.se>
Mon, 11 Jan 2021 08:37:44 +0000 (09:37 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 11 Jan 2021 11:33:23 +0000 (12:33 +0100)
As that's a significant error condition and scan-build warns for NULL
pointer dereferences if we don't.

Closes #6433

lib/multi.c

index a40db6bd8f699658bf4115a57ca253b6edfaa7c3..9dec278f3d406d8798a08f4b0582db9c5ef69d88 100644 (file)
@@ -1589,9 +1589,12 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
       process_pending_handles(multi); /* multiplexed */
     }
 
-    if(data->conn && data->mstate > CURLM_STATE_CONNECT &&
+    if(data->mstate > CURLM_STATE_CONNECT &&
        data->mstate < CURLM_STATE_COMPLETED) {
       /* Make sure we set the connection's current owner */
+      DEBUGASSERT(data->conn);
+      if(!data->conn)
+        return CURLM_INTERNAL_ERROR;
       data->conn->data = data;
     }