summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2022-03-16 13:48:27 +1100
committerPauli <pauli@openssl.org>2022-03-23 11:10:32 +1100
commita0238b7ed87998c48b1c92bad7fa82dcbba507f9 (patch)
tree56a8839a1af65c2d5f276bd1612cb6e0e2b20471 /crypto
parent6889ebff01fa8cd7e5905f3f242edfed55fca443 (diff)
Fix Coverity 1201763 uninitialised pointer read
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17890)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/bn/bn_exp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/bn/bn_exp.c b/crypto/bn/bn_exp.c
index bb20e1683e..9b6f18a70a 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))