Skip to content

Commit e4f4274

Browse files
committed
Fix AesSivCipher heap hint on cleanup.
1 parent 4753e1c commit e4f4274

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

wolfcrypt/src/aes.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14033,6 +14033,13 @@ static WARN_UNUSED_RESULT int AesSivCipher(
1403314033
}
1403414034
}
1403514035

14036+
#ifndef WOLFSSL_SMALL_STACK
14037+
/* make aes has heap hint and isAllocated initialized for cleanup below */
14038+
if (ret != 0) {
14039+
XMEMSET(aes, 0, sizeof(Aes));
14040+
}
14041+
#endif
14042+
1403614043
if (ret == 0 && dataSz > 0) {
1403714044
sivTmp[12] &= 0x7f;
1403814045
sivTmp[8] &= 0x7f;
@@ -14066,7 +14073,6 @@ static WARN_UNUSED_RESULT int AesSivCipher(
1406614073
if (aes != NULL)
1406714074
#endif
1406814075
{
14069-
aes->isAllocated = 0;
1407014076
wc_AesFree(aes);
1407114077
#ifdef WOLFSSL_SMALL_STACK
1407214078
XFREE(aes, NULL, DYNAMIC_TYPE_AES);

0 commit comments

Comments
 (0)