From 3916ca197e8e21ab253204af70687b172685d92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Wed, 2 Feb 2022 14:09:05 +0100 Subject: [PATCH] MINOR: quic: Variable used before being checked in ha_quic_add_handshake_data() This should fix Coverity CID 375058 in GH issue #1536 --- src/xprt_quic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/xprt_quic.c b/src/xprt_quic.c index ddbe03147..29cffdeb1 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -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;