From eab451339cc764e58002161860ec88c41ee5401a Mon Sep 17 00:00:00 2001 From: Stanislav Klima Date: Thu, 16 Apr 2020 09:52:02 +0200 Subject: [PATCH] Fixed dereference after null check. --- wolfcrypt/src/asn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index a2eeaf039..1bce4026d 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -13575,6 +13575,8 @@ static int EncodeCertReq(Cert* cert, DerCert* der, RsaKey* rsaKey, #ifdef HAVE_ECC if (cert->keyType == ECC_KEY) { + if (eccKey == NULL) + return PUBLIC_KEY_E; der->publicKeySz = SetEccPublicKey(der->publicKey, eccKey, 1); } #endif