From e2689a06567975141acadad6f7900de02931e806 Mon Sep 17 00:00:00 2001 From: toddouska Date: Fri, 3 Jul 2015 09:50:16 -0700 Subject: [PATCH] fix opensslextra small stack invalid free --- src/ssl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index db75781e4..564605344 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -2147,8 +2147,10 @@ static int wolfssl_decrypt_buffer_key(buffer* der, byte* password, int passwordS if ((ret = EVP_BytesToKey(info->name, "MD5", info->iv, password, passwordSz, 1, key, iv)) <= 0) { - XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER); - XFREE(iv, NULL, DYNAMIC_TYPE_TMP_BUFFER); + #ifdef WOLFSSL_SMALL_STACK + XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(iv, NULL, DYNAMIC_TYPE_TMP_BUFFER); + #endif return ASN_INPUT_E; }