Fix null-pointer dereference
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
edac5dc220
commit
bcfa19a8d1
@ -967,11 +967,11 @@ static int ubsec_dh_generate_key(DH *dh)
|
|||||||
|
|
||||||
if (dh->pub_key == NULL) {
|
if (dh->pub_key == NULL) {
|
||||||
pub_key = BN_new();
|
pub_key = BN_new();
|
||||||
|
if (pub_key == NULL)
|
||||||
|
goto err;
|
||||||
pub_key_len = BN_num_bits(dh->p);
|
pub_key_len = BN_num_bits(dh->p);
|
||||||
if (bn_wexpand(pub_key, dh->p->top) == NULL)
|
if (bn_wexpand(pub_key, dh->p->top) == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
if (pub_key == NULL)
|
|
||||||
goto err;
|
|
||||||
} else {
|
} else {
|
||||||
pub_key = dh->pub_key;
|
pub_key = dh->pub_key;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user