From: Bernd Edlinger Date: Tue, 13 Jun 2017 19:22:45 +0000 (+0200) Subject: Fix a possible crash in dsa_builtin_paramgen2. X-Git-Tag: OpenSSL_1_0_2m~72 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f3ce10ba15fc83603848354a3303e68b7ba18419;p=oweals%2Fopenssl.git Fix a possible crash in dsa_builtin_paramgen2. Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/3675) (cherry picked from commit fb0a64126b8c11a6961dfa1323c3602b591af7df) --- diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index 1fce0f81c2..21af2e159f 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -482,6 +482,8 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N, } else { p = BN_CTX_get(ctx); q = BN_CTX_get(ctx); + if (q == NULL) + goto err; } if (!BN_lshift(test, BN_value_one(), L - 1))