summaryrefslogtreecommitdiffstats
path: root/crypto/dsa
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2017-06-13 21:22:45 +0200
committerRich Salz <rsalz@openssl.org>2017-06-14 09:50:59 -0400
commit388105fff3a3290806f411f0ea1d384adecb7ffa (patch)
tree64025b02f7ae12b7dde02e6d9568390479543410 /crypto/dsa
parentded1b50f83c4d0d3e12a2a64d3bd66a27884136e (diff)
Fix a possible crash in dsa_builtin_paramgen2.
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3675) (cherry picked from commit fb0a64126b8c11a6961dfa1323c3602b591af7df)
Diffstat (limited to 'crypto/dsa')
-rw-r--r--crypto/dsa/dsa_gen.c2
1 files changed, 2 insertions, 0 deletions
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))