File openssl-CVE-2009-3245.patch of Package compat-openssl097g.import4909

Index: openssl-0.9.7d/crypto/engine/hw_ubsec.c
===================================================================
--- openssl-0.9.7d.orig/crypto/engine/hw_ubsec.c
+++ openssl-0.9.7d/crypto/engine/hw_ubsec.c
@@ -924,7 +924,7 @@ static int ubsec_dh_generate_key (DH *dh
                 priv_key = BN_new();
                 if (priv_key == NULL) goto err;
                 priv_key_len = BN_num_bits(dh->p);
-                bn_wexpand(priv_key, dh->p->top);
+                if(bn_wexpand(priv_key, dh->p->top) == NULL) goto err;
                 do
                         if (!BN_rand_range(priv_key, dh->p)) goto err;
                 while (BN_is_zero(priv_key));
@@ -939,7 +939,7 @@ static int ubsec_dh_generate_key (DH *dh
                 {
                 pub_key = BN_new();
                 pub_key_len = BN_num_bits(dh->p);
-                bn_wexpand(pub_key, dh->p->top);
+                if(bn_wexpand(pub_key, dh->p->top) == NULL) goto err;
                 if(pub_key == NULL) goto err;
                 }
         else
openSUSE Build Service is sponsored by