From b2463f167c237953e16a999474674365d38ccd4a Mon Sep 17 00:00:00 2001 From: Albert Ribes Date: Mon, 21 Jul 2025 10:57:50 +0200 Subject: [PATCH] Avoid bogus warning on uninitialized variables on old versions of GCC gcc-4.3.3 erroneously complains that some variables may be used uninitialized. Silence it assigning NULL on declaration, as is already done with many other variables. --- src/ssl.c | 2 +- tests/api.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index 4191557cf..cecc7feba 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -3855,7 +3855,7 @@ WOLFSSL_ABI int wolfSSL_UseALPN(WOLFSSL* ssl, char *protocol_name_list, word32 protocol_name_listSz, byte options) { - char *list, *ptr, **token; + char *list, *ptr = NULL, **token; word16 len; int idx = 0; int ret = WC_NO_ERR_TRACE(WOLFSSL_FAILURE); diff --git a/tests/api.c b/tests/api.c index 92272d02e..f0b1169f8 100644 --- a/tests/api.c +++ b/tests/api.c @@ -47339,7 +47339,7 @@ static int test_sk_X509_CRL(void) #endif WOLFSSL_X509_REVOKED revoked; WOLFSSL_ASN1_INTEGER* asnInt = NULL; - const WOLFSSL_ASN1_INTEGER* sn; + const WOLFSSL_ASN1_INTEGER* sn = NULL; #if (!defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)) || \ !defined(NO_BIO) @@ -56468,7 +56468,7 @@ static int test_wolfSSL_EC_KEY_private_key(void) WOLFSSL_EC_KEY* key = NULL; WOLFSSL_BIGNUM* priv = NULL; WOLFSSL_BIGNUM* priv2 = NULL; - WOLFSSL_BIGNUM* bn; + WOLFSSL_BIGNUM* bn = NULL; ExpectNotNull(key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1)); ExpectNotNull(priv = wolfSSL_BN_new());