]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Non initialized variable in quic_build_post_handshake_frames()
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 21 Mar 2022 11:01:22 +0000 (12:01 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 21 Mar 2022 13:30:23 +0000 (14:30 +0100)
<cid> could be accessed before being initialized.

src/xprt_quic.c

index a386d81062c26aa8c90e33f7687cecea56051216..b9aaeabaf1110f8a8ee699debd54b07da86ec35f 100644 (file)
@@ -2983,14 +2983,15 @@ static int quic_build_post_handshake_frames(struct quic_conn *qc)
        while (node) {
                struct quic_connection_id *cid;
 
+
+               cid = eb64_entry(&node->node, struct quic_connection_id, seq_num);
                if (cid->seq_num.key >= max)
                        break;
 
-               cid = eb64_entry(&node->node, struct quic_connection_id, seq_num);
-               node = eb64_next(node);
                if (cid->seq_num.key < first)
                        continue;
 
+               node = eb64_next(node);
                ebmb_delete(&cid->node);
                eb64_delete(&cid->seq_num);
                pool_free(pool_head_quic_connection_id, cid);