[openssl-commits] [openssl] master update

Emilia Kasper emilia at openssl.org
Mon Aug 31 14:41:30 UTC 2015


The branch master has been updated
       via  4d04226c2ec7e7f69f6234def63631648e35e828 (commit)
      from  9db0c91c39fb548c36d6c3c944f50d4c068eefb7 (commit)


- Log -----------------------------------------------------------------
commit 4d04226c2ec7e7f69f6234def63631648e35e828
Author: Emilia Kasper <emilia at openssl.org>
Date:   Mon Aug 31 13:57:44 2015 +0200

    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: Richard Levitte <levitte at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 test/bntest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/bntest.c b/test/bntest.c
index cf4d2ab..430d2a0 100644
--- a/test/bntest.c
+++ b/test/bntest.c
@@ -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);
 


More information about the openssl-commits mailing list