]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: prevent crash on qc_new_conn() failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 19 Apr 2023 08:45:40 +0000 (10:45 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 20 Apr 2023 12:49:32 +0000 (14:49 +0200)
Properly initialize el_th_ctx member first on qc_new_conn(). This
prevents a segfault if release should be called later due to memory
allocation failure in the function on qc_detach_th_ctx_list().

This should be backported up to 2.7.

src/quic_conn.c

index ca7de95102e99cf2a941c5e6b7dbdf4a9b32aafa..8a0647405cbaa176392dbf3a5948853ccae0629b 100644 (file)
@@ -5471,6 +5471,7 @@ static struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4,
        qc_init_fd(qc);
 
        LIST_INIT(&qc->back_refs);
+       LIST_INIT(&qc->el_th_ctx);
 
        /* Now proceeds to allocation of qc members. */