In wc_ecc_verify_hash_ex, return if ALLOC_CURVE_SPECS() fails

This prevents a NULL pointer dereference later in the function.
This commit is contained in:
Guido Vranken
2021-06-20 22:29:20 +02:00
parent 149920fc14
commit 7c600e3ebc

View File

@ -7108,6 +7108,9 @@ int wc_ecc_verify_hash_ex(mp_int *r, mp_int *s, const byte* hash,
#if !defined(WOLFSSL_SP_MATH) || defined(FREESCALE_LTC_ECC)
ALLOC_CURVE_SPECS(ECC_CURVE_FIELD_COUNT, err);
if (err != 0) {
return err;
}
#if defined(WOLFSSL_ASYNC_CRYPT) && defined(HAVE_CAVIUM_V)
err = wc_ecc_alloc_mpint(key, &key->e);