From dee01cfe9bd3571cd869f22d29e014d2a293e2d7 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 23 Dec 2022 13:22:40 -0800 Subject: [PATCH] Fixes SP math all build issue with small-stack and no hardening. Fixes ZD15388 --- wolfcrypt/src/sp_int.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index 29efb617a..41d658056 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -12692,7 +12692,11 @@ static int _sp_exptmod_base_2(const sp_int* e, int digits, const sp_int* m, sp_print(r, "rme"); #endif +#ifndef WC_NO_HARDEN FREE_SP_INT_ARRAY(d, NULL); +#else + FREE_SP_INT(tr, m->used * 2 + 1); +#endif return err; } #endif