From fb0a64126b8c11a6961dfa1323c3602b591af7df Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Tue, 13 Jun 2017 21:22:45 +0200 Subject: [PATCH] Fix a possible crash in dsa_builtin_paramgen2. Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/3675) --- crypto/dsa/dsa_gen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index 3efeab84fa..e58ad8d70d 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -376,6 +376,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)) -- 2.25.1