From 7f7b8d687173bd65ba2acea130ea25bd809e41b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bodo=20M=C3=B6ller?= Date: Wed, 8 Nov 2000 10:05:34 +0000 Subject: BN_CTX-related fixes. --- crypto/bn/bn_div.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crypto/bn/bn_div.c') diff --git a/crypto/bn/bn_div.c b/crypto/bn/bn_div.c index c3772c243b..999bba756c 100644 --- a/crypto/bn/bn_div.c +++ b/crypto/bn/bn_div.c @@ -180,13 +180,13 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, BN_CTX_start(ctx); tmp=BN_CTX_get(ctx); - tmp->neg=0; snum=BN_CTX_get(ctx); sdiv=BN_CTX_get(ctx); if (dv == NULL) res=BN_CTX_get(ctx); else res=dv; - if (res == NULL) goto err; + if (sdiv == NULL || res == NULL) goto err; + tmp->neg=0; /* First we normalise the numbers */ norm_shift=BN_BITS2-((BN_num_bits(divisor))%BN_BITS2); -- cgit v1.2.3