From: Benjamin Kaduk Date: Mon, 18 Jun 2018 01:00:02 +0000 (-0500) Subject: ecdsa_ossl: address coverity nit X-Git-Tag: OpenSSL_1_1_1-pre9~246 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5295b99b5606e3502b9af06a2cf54acf2187a34a;p=oweals%2Fopenssl.git 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 (Merged from https://github.com/openssl/openssl/pull/6502) --- 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;