From 98b55d1260df37f019a2d4ebc984338fae6e8a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Sat, 17 Jun 2023 13:23:16 +0200 Subject: [PATCH] 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. --- src/quic_conn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/quic_conn.c b/src/quic_conn.c index 29d229edd..ecf30e6da 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;