summaryrefslogtreecommitdiffstats
path: root/crypto/ec
diff options
context:
space:
mode:
authorBenjamin Kaduk <kaduk@mit.edu>2018-06-17 20:00:02 -0500
committerBenjamin Kaduk <kaduk@mit.edu>2018-06-22 11:54:30 -0500
commit5295b99b5606e3502b9af06a2cf54acf2187a34a (patch)
tree8e326ac6a6e4d125300353c1234861861a1263c9 /crypto/ec
parent09fb65d5e413b7b87bf26f01ec441b44a03d4ee2 (diff)
ecdsa_ossl: address coverity nit
BN_CTX_end() does not handle NULL input, so we must manually check before calling from the cleanup handler. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6502)
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ecdsa_ossl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/ec/ecdsa_ossl.c b/crypto/ec/ecdsa_ossl.c
index 277ac16bdf..dfb0d192d9 100644
--- a/crypto/ec/ecdsa_ossl.c
+++ b/crypto/ec/ecdsa_ossl.c
@@ -336,7 +336,8 @@ ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
ECDSA_SIG_free(ret);
ret = NULL;
}
- BN_CTX_end(ctx);
+ if (ctx != NULL)
+ BN_CTX_end(ctx);
BN_CTX_free(ctx);
BN_clear_free(kinv);
return ret;