This patch makes OOM handling consistent with the rest of the file.

diff -rup openssl-1.0.0-beta4/crypto/bn/bn_mul.c openssl-1.0.0-beta4_fixed/crypto/bn/bn_mul.c
--- openssl-1.0.0-beta4/crypto/bn/bn_mul.c	2009-06-17 13:47:54.000000000 +0200
+++ openssl-1.0.0-beta4_fixed/crypto/bn/bn_mul.c	2009-11-24 16:12:35.000000000 +0100
@@ -1032,15 +1032,15 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, c
 				goto err;
 			if (al > j || bl > j)
 				{
-				bn_wexpand(t,k*4);
-				bn_wexpand(rr,k*4);
+				if (bn_wexpand(t,k*4) == NULL) goto err;
+				if (bn_wexpand(rr,k*4) == NULL) goto err;
 				bn_mul_part_recursive(rr->d,a->d,b->d,
 					j,al-j,bl-j,t->d);
 				}
 			else	/* al <= j || bl <= j */
 				{
-				bn_wexpand(t,k*2);
-				bn_wexpand(rr,k*2);
+				if (bn_wexpand(t,k*2) == NULL) goto err;
+				if (bn_wexpand(rr,k*2) == NULL) goto err;
 				bn_mul_recursive(rr->d,a->d,b->d,
 					j,al-j,bl-j,t->d);
 				}

Reply via email to