diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-06-17 11:25:42 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-06-17 11:25:42 +0000 |
commit | d70323f1c5fcc8845a2edf48b49178526b7b0305 (patch) | |
tree | faeab0c2ca161c2444282472efc8034d31fdcc75 /crypto/bn/bn_div.c | |
parent | 716cddc03cfb313d57912bb40fd95395abc2a4c0 (diff) | |
download | openssl-d70323f1c5fcc8845a2edf48b49178526b7b0305.tar.gz |
Submitted by: Peter Gutmann <pgut001@cs.auckland.ac.nz>
Approved by: steve@openssl.org
Check return values for NULL in case of malloc failure.
Diffstat (limited to 'crypto/bn/bn_div.c')
-rw-r--r-- | crypto/bn/bn_div.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/bn/bn_div.c b/crypto/bn/bn_div.c index 6db472f8c3..899d07ca24 100644 --- a/crypto/bn/bn_div.c +++ b/crypto/bn/bn_div.c @@ -229,7 +229,8 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, if (dv == NULL) res=BN_CTX_get(ctx); else res=dv; - if (sdiv == NULL || res == NULL) goto err; + if (sdiv == NULL || res == NULL || tmp == NULL || snum == NULL) + goto err; /* First we normalise the numbers */ norm_shift=BN_BITS2-((BN_num_bits(divisor))%BN_BITS2); |