]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: fix potential null dereference
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Dec 2021 15:27:56 +0000 (16:27 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Dec 2021 15:32:19 +0000 (16:32 +0100)
This is not a real issue because found_in_dcid can not be set if qc is
NULL.

src/xprt_quic.c

index 04b4bba908f04232246bcedf7c1a51fcc2413124..f486ebad8343caa772169a3559e08d269df0636a 100644 (file)
@@ -3923,7 +3923,7 @@ static struct quic_conn *retrieve_qc_conn_from_cid(struct quic_rx_packet *pkt,
         *
         * node.leaf_p is first checked to avoid unnecessary locking.
         */
-       if (found_in_dcid && qc->odcid_node.node.leaf_p) {
+       if (qc && found_in_dcid && qc->odcid_node.node.leaf_p) {
                HA_RWLOCK_WRLOCK(QUIC_LOCK, &l->rx.cids_lock);
                ebmb_delete(&qc->odcid_node);
                HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &l->rx.cids_lock);