diff --git a/src/internal.c b/src/internal.c index 0edd4f226..befbd0a40 100644 --- a/src/internal.c +++ b/src/internal.c @@ -35719,6 +35719,9 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, (void)ssl; + if (args == NULL) + return; + #if defined(HAVE_ECC) || defined(HAVE_CURVE25519) || defined(HAVE_CURVE448) XFREE(args->exportBuf, ssl->heap, DYNAMIC_TYPE_DER); args->exportBuf = NULL; @@ -35728,16 +35731,10 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, args->verifySig = NULL; #endif - if ( - #ifdef WOLFSSL_ASYNC_IO - args != NULL && - #endif - args->input != NULL) { + if (args->input != NULL) { XFREE(args->input, ssl->heap, DYNAMIC_TYPE_IN_BUFFER); args->input = NULL; } - - (void)args; } /* handle generation of server_key_exchange (12) */ diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index b04e81f5c..454adf6a0 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -19271,18 +19271,15 @@ static int _sp_prime_trials(const sp_int* a, int trials, int* result) { int err = MP_OKAY; int i; - sp_int* n1; - sp_int* r; - DECL_SP_INT_ARRAY(t, a->used + 1, 2); + DECL_SP_INT(n1, a->used + 1); + DECL_SP_INT(r, a->used + 1); DECL_SP_INT(b, a->used * 2 + 1); - ALLOC_SP_INT_ARRAY(t, a->used + 1, 2, err, NULL); + ALLOC_SP_INT(n1, a->used + 1, err, NULL); + ALLOC_SP_INT(r, a->used + 1, err, NULL); /* Allocate number that will hold modular exponentiation result. */ ALLOC_SP_INT(b, a->used * 2 + 1, err, NULL); if (err == MP_OKAY) { - n1 = t[0]; - r = t[1]; - _sp_init_size(n1, a->used + 1U); _sp_init_size(r, a->used + 1U); _sp_init_size(b, (sp_size_t)(a->used * 2U + 1U)); @@ -19305,7 +19302,8 @@ static int _sp_prime_trials(const sp_int* a, int trials, int* result) /* Free allocated temporary. */ FREE_SP_INT(b, NULL); - FREE_SP_INT_ARRAY(t, NULL); + FREE_SP_INT(r, NULL); + FREE_SP_INT(n1, NULL); return err; } diff --git a/wolfcrypt/src/wc_xmss_impl.c b/wolfcrypt/src/wc_xmss_impl.c index 15b2184b2..eb1ac452b 100644 --- a/wolfcrypt/src/wc_xmss_impl.c +++ b/wolfcrypt/src/wc_xmss_impl.c @@ -2590,7 +2590,7 @@ static void wc_xmss_bds_state_treehash_set_next_idx(BdsState* bds, int i, static void wc_xmss_bds_state_treehash_complete(BdsState* bds, int i) { byte* sk = bds->treeHash + i * 4; - sk[3] |= 1 << 7; + sk[3] |= 1 << 7; /* // NOLINT(clang-analyzer-core.NullDereference) */ } /* Get the tree hash data at specified index for the BDS state.