summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-08-11 17:09:18 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-08-24 11:19:28 +1000
commit825ccf515528f289ae3dfe3b34d6252c4764069a (patch)
tree3c752f1a89ce3983f0a664adb1ff1043d509231a /crypto/evp
parent10ead93897ab48233d66cc40bfdc146d6c95c4a7 (diff)
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)
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/digest.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c
index 7caab8a5f7..f5ec573828 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)));