提交 4d04226c 编写于 作者: E Emilia Kasper

Fix spurious bntest failures.

BN_bntest_rand generates a single-word zero BIGNUM with quite a large probability.

A zero BIGNUM in turn will end up having a NULL |d|-buffer, which we shouldn't dereference without checking.
Reviewed-by: NRichard Levitte <levitte@openssl.org>
上级 9db0c91c
......@@ -526,9 +526,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册