summaryrefslogtreecommitdiffstats
path: root/crypto/bn
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-12-02 15:27:19 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-12-02 15:27:19 +0000
commit1ff44a99a40567eec99efbc6059872e7912a89b9 (patch)
treed1c2defdf3571c6311cf34616d475f83b6cc88d7 /crypto/bn
parent6cf61614e4759b3446656c7c95b6eaad2059a291 (diff)
PR: 2111
Submitted by: Martin Olsson <molsson@opera.com> Check for bn_wexpand errors in bn_mul.c
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/bn_mul.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/bn/bn_mul.c b/crypto/bn/bn_mul.c
index 3a1d459dd6..a0e9ec3b46 100644
--- a/crypto/bn/bn_mul.c
+++ b/crypto/bn/bn_mul.c
@@ -1032,15 +1032,15 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
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);
}