From: Emilia Kasper Date: Mon, 31 Aug 2015 11:57:44 +0000 (+0200) Subject: bntest: don't dereference the |d| array for a zero BIGNUM. X-Git-Tag: OpenSSL_1_0_2e~119 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9c989aaa749d88b63bef5d5beeb3046eae62d836;p=oweals%2Fopenssl.git bntest: don't dereference the |d| array for a zero BIGNUM. Reviewed-by: Richard Levitte (cherry picked from commit 4d04226c2ec7e7f69f6234def63631648e35e828) --- 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);