diff options
author | Matt Caswell <matt@openssl.org> | 2016-09-14 13:27:59 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-09-21 13:32:30 +0100 |
commit | 1ff7425d6130380bb00d3e64739633a4b21b11a3 (patch) | |
tree | 43a29138968c0f20593368ca5ea2910941e4fab7 /crypto/dsa | |
parent | f3ff481f318b10a223d6157bde9645e1797487c5 (diff) |
Fix a missing NULL check in dsa_builtin_paramgen
We should check the last BN_CTX_get() call to ensure that it isn't NULL
before we try and use any of the allocated BIGNUMs.
Issue reported by Shi Lei.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/dsa')
-rw-r--r-- | crypto/dsa/dsa_gen.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index 3dac550031..11f422e4b4 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -100,6 +100,9 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, p = BN_CTX_get(ctx); test = BN_CTX_get(ctx); + if (test == NULL) + goto err; + if (!BN_lshift(test, BN_value_one(), bits - 1)) goto err; |