diff options
author | Pauli <pauli@openssl.org> | 2022-03-16 03:48:27 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-03-23 01:10:32 +0100 |
commit | a0238b7ed87998c48b1c92bad7fa82dcbba507f9 (patch) | |
tree | 56a8839a1af65c2d5f276bd1612cb6e0e2b20471 /crypto | |
parent | Fix Coverity 1498613: resource leak (diff) | |
download | openssl-a0238b7ed87998c48b1c92bad7fa82dcbba507f9.tar.xz openssl-a0238b7ed87998c48b1c92bad7fa82dcbba507f9.zip |
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.c | 3 |
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)) |