Fix null-pointer dereference

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit bcfa19a8d19506c26b5f8d9d9934ca2aa5f96b43)
This commit is contained in:
Edgar Pek 2015-02-21 14:56:41 +01:00 committed by Kurt Roeckx
parent f95519538a
commit 98e6f07901

View File

@ -967,11 +967,11 @@ static int ubsec_dh_generate_key(DH *dh)
if (dh->pub_key == NULL) {
pub_key = BN_new();
if (pub_key == NULL)
goto err;
pub_key_len = BN_num_bits(dh->p);
if (bn_wexpand(pub_key, dh->p->top) == NULL)
goto err;
if (pub_key == NULL)
goto err;
} else {
pub_key = dh->pub_key;
}