From: Matt Caswell Date: Wed, 27 Apr 2016 12:32:58 +0000 (+0100) Subject: Check that we were actually allocated BIGNUMs in dsa_builtin_paramgen2 X-Git-Tag: OpenSSL_1_1_0-pre6~1031 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f08e8034505ae69d6b986f20a63b705d1f012744;p=oweals%2Fopenssl.git 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 --- 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) {