diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-08-11 16:33:19 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-08-24 11:19:28 +1000 |
commit | 51bba73e9361d19a0827e4459c01a7b3f6712415 (patch) | |
tree | 56cfd5df6c847ebd160167830cd5af638aa1f815 /providers | |
parent | fdf6118b1552bc723aeba726174b14ca07b5170a (diff) |
Fix coverity CID #1458645 - Dereference before NULL check in rsa_digest_verify_final()
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12628)
Diffstat (limited to 'providers')
-rw-r--r-- | providers/implementations/signature/rsa.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/providers/implementations/signature/rsa.c b/providers/implementations/signature/rsa.c index 7e2de96e83..1a2238f0a8 100644 --- a/providers/implementations/signature/rsa.c +++ b/providers/implementations/signature/rsa.c @@ -775,10 +775,11 @@ static int rsa_digest_sign_final(void *vprsactx, unsigned char *sig, unsigned char digest[EVP_MAX_MD_SIZE]; unsigned int dlen = 0; + if (prsactx == NULL) + return 0; prsactx->flag_allow_md = 1; - if (prsactx == NULL || prsactx->mdctx == NULL) + if (prsactx->mdctx == NULL) return 0; - /* * If sig is NULL then we're just finding out the sig size. Other fields * are ignored. Defer to rsa_sign. |