diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-01-11 09:37:44 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-01-11 12:33:23 +0100 |
commit | 06f1db57cac8ade2602fba61909c8d54b57fa10b (patch) | |
tree | 86e7e94aff01bc6ea0bf5b1050f9a425c62e55e0 | |
parent | 48220f7e3d4431879602f8d3bf231bf6f635ca79 (diff) | |
download | curl-06f1db57cac8ade2602fba61909c8d54b57fa10b.tar.gz |
multi_runsingle: bail out early on data->conn == NULL
As that's a significant error condition and scan-build warns for NULL
pointer dereferences if we don't.
Closes #6433
-rw-r--r-- | lib/multi.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/multi.c b/lib/multi.c index a40db6bd8..9dec278f3 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -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; } |