]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cf-h2-proxy: break loop on edge case
authorStefan Eissing <stefan@eissing.org>
Thu, 25 Sep 2025 08:42:24 +0000 (10:42 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Sep 2025 09:22:24 +0000 (11:22 +0200)
nghttp2 always consumes the memory, but be safe in case it ever decideds
to not to.

Fixes J2
Reported in Joshua's sarif data
Closes #18715

lib/cf-h2-proxy.c

index d67bbd55adfbf2ee76ff1fcff657915a691b9cb3..17a15c1d2ada81ac899060bdf2a5b945b8e9134c 100644 (file)
@@ -433,6 +433,11 @@ static int proxy_h2_process_pending_input(struct Curl_cfilter *cf,
       *err = CURLE_RECV_ERROR;
       return -1;
     }
+    else if(!rv) {
+      /* nghttp2 does not want to process more, but has no error. This
+       * probably cannot happen, but be safe. */
+      break;
+    }
     Curl_bufq_skip(&ctx->inbufq, (size_t)rv);
     if(Curl_bufq_is_empty(&ctx->inbufq)) {
       CURL_TRC_CF(data, cf, "[0] all data in connection buffer processed");