From: Shane Lontis Date: Tue, 11 Aug 2020 07:09:18 +0000 (+1000) Subject: Fix coverity CID #1454638 - Dereference after NULL check in EVP_MD_CTX_gettable_params() X-Git-Tag: openssl-3.0.0-alpha7~498 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=825ccf515528f289ae3dfe3b34d6252c4764069a;p=thirdparty%2Fopenssl.git Fix coverity CID #1454638 - Dereference after NULL check in EVP_MD_CTX_gettable_params() Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/12628) --- diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c index 7caab8a5f78..f5ec573828a 100644 --- a/crypto/evp/digest.c +++ b/crypto/evp/digest.c @@ -671,8 +671,10 @@ const OSSL_PARAM *EVP_MD_CTX_gettable_params(EVP_MD_CTX *ctx) { EVP_PKEY_CTX *pctx; - if (ctx != NULL - && ctx->digest != NULL + if (ctx == NULL) + return NULL; + + if (ctx->digest != NULL && ctx->digest->gettable_ctx_params != NULL) return ctx->digest->gettable_ctx_params( ossl_provider_ctx(EVP_MD_provider(ctx->digest)));