summaryrefslogtreecommitdiffstats
path: root/crypto/bn
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2015-08-31 13:57:44 +0200
committerEmilia Kasper <emilia@openssl.org>2015-08-31 16:53:04 +0200
commit9c989aaa749d88b63bef5d5beeb3046eae62d836 (patch)
treebc75de13d06281e597df937672adc76d607bc18f /crypto/bn
parentf21fb858d313909221fdafb26383794bc587f71d (diff)
bntest: don't dereference the |d| array for a zero BIGNUM.
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 4d04226c2ec7e7f69f6234def63631648e35e828)
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/bntest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/bn/bntest.c b/crypto/bn/bntest.c
index 470d5dabf1..0f8e18f396 100644
--- a/crypto/bn/bntest.c
+++ b/crypto/bn/bntest.c
@@ -516,9 +516,9 @@ int test_div_word(BIO *bp)
do {
BN_bntest_rand(&a, 512, -1, 0);
BN_bntest_rand(&b, BN_BITS2, -1, 0);
- s = b.d[0];
- } while (!s);
+ } while (BN_is_zero(&b));
+ s = b.d[0];
BN_copy(&b, &a);
r = BN_div_word(&b, s);