From: Frédéric Lécaille Date: Sat, 17 Jun 2023 11:23:16 +0000 (+0200) Subject: BUG/MINOR: quic: Missing transport parameters initializations X-Git-Tag: v2.9-dev1~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98b55d1260df37f019a2d4ebc984338fae6e8a7f;p=thirdparty%2Fhaproxy.git BUG/MINOR: quic: Missing transport parameters initializations This bug was introduced by this commit: MINOR: quic: Remove pool_zalloc() from qc_new_conn() The transport parameters was not initialized. This leaded to a crash when dumping the received ones from TRACE()s. Also reset the lengths of the CIDs attached to a quic_conn struct to 0 value to prevent them from being dumped from traces when not already initialized. No backport needed. --- diff --git a/src/quic_conn.c b/src/quic_conn.c index 29d229edd7..ecf30e6daa 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -5542,6 +5542,8 @@ static struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4, /* Initialize in priority qc members required for a safe dealloc. */ + /* Prevents these CID to be dumped by TRACE() calls */ + qc->scid.len = qc->odcid.len = qc->dcid.len = 0; /* required to use MTLIST_IN_LIST */ MT_LIST_INIT(&qc->accept_list); @@ -5688,9 +5690,11 @@ static struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4, qc->tx.nb_buf = QUIC_CONN_TX_BUFS_NB; qc->tx.wbuf = qc->tx.rbuf = 0; qc->tx.bytes = qc->tx.prep_bytes = 0; + memset(&qc->tx.params, 0, sizeof(qc->tx.params)); qc->tx.buf = BUF_NULL; /* RX part. */ qc->rx.bytes = 0; + memset(&qc->rx.params, 0, sizeof(qc->rx.params)); qc->rx.buf = b_make(qc->rx.buf.area, QUIC_CONN_RX_BUFSZ, 0, 0); for (i = 0; i < QCS_MAX_TYPES; i++) qc->rx.strms[i].nb_streams = 0;