diff options
author | Pauli <paul.dale@oracle.com> | 2020-04-27 00:26:39 +0200 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-04-30 12:21:31 +0200 |
commit | 089c292825a3b64ed375223751bd84a6da8312c1 (patch) | |
tree | a15229b6c96a33521c67aece319ed9aa5e61f815 /crypto/evp/m_sigver.c | |
parent | coverity 1462545 Dereference after null check (diff) | |
download | openssl-089c292825a3b64ed375223751bd84a6da8312c1.tar.xz openssl-089c292825a3b64ed375223751bd84a6da8312c1.zip |
coverity 1462546 Dereference after null check
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11651)
Diffstat (limited to 'crypto/evp/m_sigver.c')
-rw-r--r-- | crypto/evp/m_sigver.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c index 829b861ed2..c77683a69d 100644 --- a/crypto/evp/m_sigver.c +++ b/crypto/evp/m_sigver.c @@ -347,11 +347,13 @@ int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize) data, dsize); legacy: - /* do_sigver_init() checked that |digest_custom| is non-NULL */ - if (pctx->flag_call_digest_custom - && !ctx->pctx->pmeth->digest_custom(ctx->pctx, ctx)) - return 0; - pctx->flag_call_digest_custom = 0; + if (pctx != NULL) { + /* do_sigver_init() checked that |digest_custom| is non-NULL */ + if (pctx->flag_call_digest_custom + && !ctx->pctx->pmeth->digest_custom(ctx->pctx, ctx)) + return 0; + pctx->flag_call_digest_custom = 0; + } return EVP_DigestUpdate(ctx, data, dsize); } |