From: Dr. Stephen Henson Date: Wed, 2 Dec 2009 15:28:42 +0000 (+0000) Subject: PR: 2111 X-Git-Tag: OpenSSL-fips-2_0-rc1~1410 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=7e4cae1d2f555cbe9226b377aff4b56c9f7ddd4d;hp=9d9530255b6f556a1ffbbb466fc315c95978d329 PR: 2111 Submitted by: Martin Olsson Check for bn_wexpand errors in bn_mul.c --- 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); }