]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC FC: TEST: Coverity
authorHugo Landau <hlandau@openssl.org>
Thu, 27 Jul 2023 14:56:44 +0000 (15:56 +0100)
committerHugo Landau <hlandau@openssl.org>
Thu, 10 Aug 2023 17:19:50 +0000 (18:19 +0100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21565)

test/quic_fc_test.c

index 14179b6d4c47ba7f6e951eeef9f4104a1e4cc02f..56ea103a422fc821b9361677847c0ec6a4a49b1c 100644 (file)
@@ -470,7 +470,7 @@ static int run_rxfc_script(const struct rx_test_op *script)
 #define MAX_STREAMS     3
     int testresult = 0;
     const struct rx_test_op *op = script;
-    QUIC_RXFC conn_rxfc, stream_rxfc[MAX_STREAMS];
+    QUIC_RXFC conn_rxfc = {0}, stream_rxfc[MAX_STREAMS] = {0}; /* coverity */
     char stream_init_done[MAX_STREAMS] = {0};
     int conn_init_done = 0;
 
@@ -488,7 +488,8 @@ static int run_rxfc_script(const struct rx_test_op *script)
                 break;
 
             case RX_OPC_INIT_STREAM:
-                if (!TEST_size_t_lt(op->stream_idx, OSSL_NELEM(stream_rxfc)))
+                if (!TEST_size_t_lt(op->stream_idx, OSSL_NELEM(stream_rxfc))
+                    || !TEST_true(conn_init_done))
                     goto err;
 
                 if (!TEST_true(ossl_quic_rxfc_init(&stream_rxfc[op->stream_idx],