Avoid use of uninitialized array

This commit is contained in:
Andras Fekete
2023-10-27 13:42:33 -04:00
parent 2877b7be50
commit 42c241dbbf
6 changed files with 28 additions and 3 deletions

View File

@@ -1125,6 +1125,7 @@ static int wc_HpkeContextOpenBase(Hpke* hpke, HpkeBaseContext* context,
return BAD_FUNC_ARG;
}
XMEMSET(nonce, 0, sizeof(nonce));
#ifdef WOLFSSL_SMALL_STACK
aes_key = (Aes*)XMALLOC(sizeof(Aes), hpke->heap, DYNAMIC_TYPE_AES);
if (aes_key == NULL) {

View File

@@ -8693,6 +8693,7 @@ static int wc_PKCS7_DecryptKtri(PKCS7* pkcs7, byte* in, word32 inSz,
mp_int serialNum[1];
RsaKey privKey[1];
#endif
XMEMSET(issuerHash, 0, sizeof(issuerHash));
#if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3)
keyIdSize = wc_HashGetDigestSize(wc_HashTypeConvert(HashIdAlg(