Fix coverity CID #1454638 - Dereference after NULL check in EVP_MD_CTX_gettable_params()

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12628)
This commit is contained in:
Shane Lontis 2020-08-11 17:09:18 +10:00
parent 10ead93897
commit 825ccf5155

View File

@ -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)));