From: Pauli Date: Wed, 16 Mar 2022 02:48:27 +0000 (+1100) Subject: Fix Coverity 1201763 uninitialised pointer read X-Git-Tag: openssl-3.2.0-alpha1~2822 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0238b7ed87998c48b1c92bad7fa82dcbba507f9;p=thirdparty%2Fopenssl.git Fix Coverity 1201763 uninitialised pointer read Reviewed-by: Shane Lontis Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/17890) --- diff --git a/crypto/bn/bn_exp.c b/crypto/bn/bn_exp.c index bb20e1683e0..9b6f18a70ac 100644 --- a/crypto/bn/bn_exp.c +++ b/crypto/bn/bn_exp.c @@ -187,13 +187,14 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, return ret; } + BN_RECP_CTX_init(&recp); + BN_CTX_start(ctx); aa = BN_CTX_get(ctx); val[0] = BN_CTX_get(ctx); if (val[0] == NULL) goto err; - BN_RECP_CTX_init(&recp); if (m->neg) { /* ignore sign of 'm' */ if (!BN_copy(aa, m))