]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: h3: fix crash on h3s alloc failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 19 Apr 2023 09:49:16 +0000 (11:49 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 20 Apr 2023 12:49:32 +0000 (14:49 +0200)
Do not emit a CONNECTION_CLOSE on h3s allocation failure. Indeed, this
causes a crash as the calling function qcs_new() will also try to emit a
CONNECTION_CLOSE which triggers a BUG_ON() on qcc_emit_cc().

This was reproduced using -dMfail.

This should be backported up to 2.7.

src/h3.c

index 909942bfd44ff0700456f89122aa16b03ef99522..09099ec4796de518e512323343ff7c22e2ab8e0e 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -1707,7 +1707,6 @@ static int h3_attach(struct qcs *qcs, void *conn_ctx)
        h3s = pool_alloc(pool_head_h3s);
        if (!h3s) {
                TRACE_ERROR("h3s allocation failure", H3_EV_H3S_NEW, qcs->qcc->conn, qcs);
-               qcc_emit_cc_app(qcs->qcc, H3_INTERNAL_ERROR, 1);
                goto err;
        }