From bcfa19a8d19506c26b5f8d9d9934ca2aa5f96b43 Mon Sep 17 00:00:00 2001 From: Edgar Pek Date: Sat, 21 Feb 2015 14:56:41 +0100 Subject: [PATCH] Fix null-pointer dereference Signed-off-by: Kurt Roeckx Reviewed-by: Richard Levitte --- engines/e_ubsec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/e_ubsec.c b/engines/e_ubsec.c index 2d6331d690..6f09ffb965 100644 --- a/engines/e_ubsec.c +++ b/engines/e_ubsec.c @@ -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; } -- 2.25.1