From f08e8034505ae69d6b986f20a63b705d1f012744 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Wed, 27 Apr 2016 13:32:58 +0100 Subject: [PATCH] Check that we were actually allocated BIGNUMs in dsa_builtin_paramgen2 Calls to BN_CTX_get() can fail so we should check that they were successful. Reviewed-by: Richard Levitte --- 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 c278d9853d..d97a06b456 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -406,6 +406,8 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N, X = BN_CTX_get(ctx); c = BN_CTX_get(ctx); test = BN_CTX_get(ctx); + if (test == NULL) + goto err; /* if p, q already supplied generate g only */ if (ret->p && ret->q) { -- 2.34.1