From: Bernd Edlinger Date: Tue, 13 Jun 2017 20:08:03 +0000 (+0200) Subject: Fix another possible crash in rsa_ossl_mod_exp. X-Git-Tag: OpenSSL_1_1_0g~173 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ded1b50f83c4d0d3e12a2a64d3bd66a27884136e;p=oweals%2Fopenssl.git Fix another possible crash in rsa_ossl_mod_exp. Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/3675) (cherry picked from commit 5625567f9c7daaa2e2689647e10e4c5d7370718f) --- diff --git a/crypto/rsa/rsa_ossl.c b/crypto/rsa/rsa_ossl.c index 793e2f9c87..62a88959fa 100644 --- a/crypto/rsa/rsa_ossl.c +++ b/crypto/rsa/rsa_ossl.c @@ -603,6 +603,8 @@ static int rsa_ossl_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx) r1 = BN_CTX_get(ctx); m1 = BN_CTX_get(ctx); vrfy = BN_CTX_get(ctx); + if (vrfy == NULL) + goto err; { BIGNUM *p = BN_new(), *q = BN_new();