From dafb5a80e71113f44274c37db5b56fae83a1ff6f Mon Sep 17 00:00:00 2001 From: toddouska Date: Tue, 7 Jul 2015 09:23:02 -0700 Subject: [PATCH] recommit invalid free w/o smallstack --- src/ssl.c | 2 ++ wolfcrypt/test/test.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ssl.c b/src/ssl.c index cad25dd21..64947d9c5 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -2201,8 +2201,10 @@ static int wolfssl_decrypt_buffer_key(buffer* der, byte* password, if ((ret = EVP_BytesToKey(info->name, "MD5", info->iv, password, passwordSz, 1, key, iv)) <= 0) { +#ifdef WOLFSSL_SMALL_STACK XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(iv, NULL, DYNAMIC_TYPE_TMP_BUFFER); +#endif return ASN_INPUT_E; } diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index fb3ad7305..6286e3eac 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -1908,7 +1908,7 @@ int chacha_test(void) byte plain[128]; byte sliver[64]; byte input[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - word32 keySz; + word32 keySz = 32; int ret = 0; int i; int times = 4;