]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC RADIX TEST: Quiet warnings about uninitialized variables
authorHugo Landau <hlandau@openssl.org>
Mon, 5 Feb 2024 18:45:41 +0000 (18:45 +0000)
committerViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 11 Sep 2024 08:35:22 +0000 (18:35 +1000)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23487)

test/radix/quic_bindings.c
test/radix/terp.c

index d738d8ceaf2dab922102cdca896884d350bebe04..c5b9fe1d11e540be5e91e252aa9454a219775832 100644 (file)
@@ -657,6 +657,7 @@ static int expect_slot_ssl(FUNC_CTX *fctx, size_t idx, SSL **p_ssl)
 
 #define REQUIRE_SSL_N(idx, ssl)                                 \
     do {                                                        \
+        (ssl) = NULL; /* quiet uninitialized warnings */        \
         if (!TEST_true(expect_slot_ssl(fctx, (idx), &(ssl))))   \
             goto err;                                           \
     } while (0)
index 06aa0aa515988c4b67fd92b36d99b059afe56334..89d3cbfeaf25ab226e6a80a230b40119b7879fa2 100644 (file)
@@ -111,6 +111,7 @@ static ossl_inline int TERP_stk_pop(TERP *terp,
 
 #define TERP_STK_POP(terp, v)                                   \
     do {                                                        \
+        memset(&(v), 0, sizeof(v)); /* quiet warnings */        \
         if (!TEST_true(TERP_stk_pop((terp), &(v), sizeof(v))))  \
             goto err;                                           \
     } while (0)
@@ -361,6 +362,7 @@ static ossl_inline void SRDR_restore(SRDR *srdr)
 
 #define GET_OPERAND(srdr, v)                                        \
     do {                                                            \
+        memset(&(v), 0, sizeof(v)); /* quiet uninitialized warn */  \
         if (!TEST_true(SRDR_get_operand(srdr, &(v), sizeof(v))))    \
             goto err;                                               \
     } while (0)
@@ -411,7 +413,7 @@ static int SRDR_print_one(SRDR *srdr, BIO *bio, size_t i, int *was_end)
             void *v;
 
             GET_OPERAND(srdr, v);
-            PRINT_OPC(PUSH_P);
+            PRINT_OPC(PUSH_PZ);
             if (v != NULL && strlen((const char *)v) == 1)
                 BIO_printf(bio, "%20p (%s)", v, (const char *)v);
             else
@@ -441,7 +443,7 @@ static int SRDR_print_one(SRDR *srdr, BIO *bio, size_t i, int *was_end)
     case OPK_FUNC:
         {
             helper_func_t v;
-            void *f_name, *x;
+            void *f_name = NULL, *x = NULL;
 
             GET_OPERAND(srdr, v);
             GET_OPERAND(srdr, f_name);