From 8440973d99c1ce00493cb718e7443376065c0a76 Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 27 Jul 2020 15:44:53 -0700 Subject: [PATCH] Fix for `derSz` calculation on non-const value `keySz`. ZD 10654 --- tests/api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/api.c b/tests/api.c index 565b8ae8a..e2ee60a89 100644 --- a/tests/api.c +++ b/tests/api.c @@ -131,7 +131,7 @@ #endif #endif #if !defined(DER_SZ) - #define DER_SZ (keySz * 2 + 1) + #define DER_SZ(ks) (ks * 2 + 1) #endif #endif #ifndef NO_ASN @@ -20018,9 +20018,9 @@ static int test_wc_ecc_pointFns (void) ecc_point* cpypt = NULL; int idx = 0; int keySz = KEY32; - byte der[DER_SZ]; + byte der[DER_SZ(KEY32)]; word32 derlenChk = 0; - word32 derSz = (int)sizeof(der); + word32 derSz = DER_SZ(KEY32); /* Init stack variables. */ XMEMSET(der, 0, derSz);