Skip to content

Commit 8066fbc

Browse files
committed
Fix a couple of Valgrind hits
``` ==485951== Uninitialised value was created by a stack allocation ==485951== at 0x207D47: des3_key_wrap_test (test.c:12773) ``` and ``` ==485951== Uninitialised value was created by a stack allocation ==485951== at 0x3A075E: test_wc_AesGcmArgMcdc (test_aes.c:8968) ```
1 parent 69bf010 commit 8066fbc

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/api/test_aes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9173,7 +9173,7 @@ int test_wc_AesGcmArgMcdc(void)
91739173
/* ---- wc_AesGcmDecryptFinal(): nonceSet AND ---- */
91749174
{
91759175
Aes aes;
9176-
byte tag[WC_AES_BLOCK_SIZE];
9176+
byte tag[WC_AES_BLOCK_SIZE] = { 0 };
91779177

91789178
XMEMSET(&aes, 0, sizeof(aes));
91799179
ExpectIntEQ(wc_AesInit(&aes, NULL, INVALID_DEVID), 0);

wolfcrypt/test/test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12502,7 +12502,7 @@ static wc_test_ret_t des_key_wrap_test(void)
1250212502
{
1250312503
0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef
1250412504
};
12505-
byte cipher[24];
12505+
byte cipher[24] = { 0 };
1250612506
EncryptedInfo info;
1250712507
wc_test_ret_t ret;
1250812508

@@ -12759,7 +12759,7 @@ static wc_test_ret_t des3_key_wrap_test(void)
1275912759
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
1276012760
0x11,0x21,0x31,0x41,0x51,0x61,0x71,0x81
1276112761
};
12762-
byte cipher[24];
12762+
byte cipher[24] = { 0 };
1276312763
EncryptedInfo info;
1276412764
wc_test_ret_t ret;
1276512765

0 commit comments

Comments
 (0)