]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Variable used before being checked in ha_quic_add_handshake_data()
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 2 Feb 2022 13:09:05 +0000 (14:09 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 14 Feb 2022 14:20:54 +0000 (15:20 +0100)
This should fix Coverity CID 375058 in GH issue #1536

src/xprt_quic.c

index ddbe031476080f7c0989d5cdba7a2b0ed78bdbfd..29cffdeb13b18ff2b0e28c36bc1b11d69c2c7cfe 100644 (file)
@@ -1078,13 +1078,12 @@ int ha_quic_add_handshake_data(SSL *ssl, enum ssl_encryption_level_t level,
        }
 
        tel = ssl_to_quic_enc_level(level);
-       qel = &qc->els[tel];
-
        if (tel == -1) {
                TRACE_PROTO("Wrong encryption level", QUIC_EV_CONN_ADDDATA, qc);
                goto err;
        }
 
+       qel = &qc->els[tel];
        if (!quic_crypto_data_cpy(qel, data, len)) {
                TRACE_PROTO("Could not bufferize", QUIC_EV_CONN_ADDDATA, qc);
                goto err;