]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
h3-proxy: fix NULL deref when non-:status header arrives before :status master
authorRamesh Adhikari <adhikari.resume@gmail.com>
Thu, 30 Jul 2026 16:29:16 +0000 (21:59 +0530)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 31 Jul 2026 07:30:21 +0000 (09:30 +0200)
Closes #22449

lib/vquic/cf-ngtcp2-proxy.c

index ec6de93368af94bc167d3b6da2146948201b9c6b..f5c967c5b1e4c8acaf7a94beb3057a6d0cedea3d 100644 (file)
@@ -431,6 +431,9 @@ static int cb_h3_proxy_recv_header(nghttp3_conn *conn, int64_t stream_id,
     pctx->tunnel.resp = resp;
   }
   else {
+    if(!pctx->tunnel.resp) {
+      return NGHTTP3_ERR_CALLBACK_FAILURE;
+    }
     /* store as an HTTP1-style header */
     CURL_TRC_CF(data, cf, "[%" PRId64 "] header: %.*s: %.*s", stream_id,
                 (int)h3name.len, h3name.base, (int)h3val.len, h3val.base);