summaryrefslogtreecommitdiffstats
path: root/crypto/evp/m_sigver.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2020-04-26 23:51:16 +0200
committerPauli <paul.dale@oracle.com>2020-04-30 12:21:16 +0200
commit721330705a2eb040270742367721d5a006e004f4 (patch)
tree70b6bd64a2300b4292dec4856e4f7d1c11d7aa61 /crypto/evp/m_sigver.c
parentcoverity 1462577: Incorrect expression (diff)
downloadopenssl-721330705a2eb040270742367721d5a006e004f4.tar.xz
openssl-721330705a2eb040270742367721d5a006e004f4.zip
coverity 1462565: Null pointer dereferences
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.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c
index 85c1fa281a..829b861ed2 100644
--- a/crypto/evp/m_sigver.c
+++ b/crypto/evp/m_sigver.c
@@ -317,11 +317,13 @@ int EVP_DigestSignUpdate(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);
}