]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: h3: handle properly buf alloc failure on response forwarding
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 25 Nov 2025 14:46:14 +0000 (15:46 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 25 Nov 2025 14:55:08 +0000 (15:55 +0100)
Replace BUG_ON() for buffer alloc failure on h3_resp_headers_to_htx() by
proper error handling. An error status is reported which should be
sufficient to initiate connection closure.

No need to backport.

src/h3.c

index 161d0a4c3b2f578ff94c15b62f60afae0d0bf01d..9ad5ff430b46e12c2d682ff80c5ec0c58d40c3d7 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -1150,8 +1150,11 @@ static ssize_t h3_resp_headers_to_htx(struct qcs *qcs, const struct buffer *buf,
                goto out;
        }
 
-       appbuf = qcc_get_stream_rxbuf(qcs);
-       BUG_ON(!appbuf); /* TODO */
+       if (!(appbuf = qcc_get_stream_rxbuf(qcs))) {
+               TRACE_ERROR("buffer alloc failure", H3_EV_RX_FRAME|H3_EV_RX_HDR, qcs->qcc->conn, qcs);
+               len = -1;
+               goto out;
+       }
        BUG_ON(!b_size(appbuf)); /* TODO */
        htx = htx_from_buf(appbuf);