Fix another possible crash in rsa_ossl_mod_exp.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Tue, 13 Jun 2017 20:08:03 +0000 (22:08 +0200)
committerRich Salz <rsalz@openssl.org>
Wed, 14 Jun 2017 13:35:48 +0000 (09:35 -0400)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3675)

crypto/rsa/rsa_ossl.c

index 5e0ad92cb1c3c4257f1fd21da0bfad4107d399e5..92c4be1868a5b1608c1ab7841281014c1a51a692 100644 (file)
@@ -608,6 +608,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();