From 94f3540501cb1e4ee12e0e18c2d80b1dd578c5d8 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 5 Aug 2025 13:48:38 +0200 Subject: [PATCH] fix conn NULL check --- lib/cfilters.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/cfilters.c b/lib/cfilters.c index c5ac36e9e4..c3b40b0bc5 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -801,9 +801,14 @@ void Curl_conn_get_current_host(struct Curl_easy *data, int sockindex, { struct Curl_cfilter *cf, *cf_proxy = NULL; - DEBUGASSERT(data->conn); - cf = (data->conn && CONN_SOCK_IDX_VALID(sockindex)) ? - data->conn->cfilter[sockindex] : NULL; + if(!data->conn) { + DEBUGASSERT(0); + *phost = ""; + *pport = -1; + return; + } + + cf = CONN_SOCK_IDX_VALID(sockindex) ? data->conn->cfilter[sockindex] : NULL; /* Find the "lowest" tunneling proxy filter that has not connected yet. */ while(cf && !cf->connected) { if((cf->cft->flags & (CF_TYPE_IP_CONNECT|CF_TYPE_PROXY)) ==