[openssl-commits] [openssl] master update

Andy Polyakov appro at openssl.org
Mon May 22 09:08:07 UTC 2017


The branch master has been updated
       via  fee423bb68869de02fceaceefbc847e98213574b (commit)
      from  a486561b691d6293a901b412172ca0c6d1ffc0dc (commit)


- Log -----------------------------------------------------------------
commit fee423bb68869de02fceaceefbc847e98213574b
Author: Todd Short <tshort at akamai.com>
Date:   Sun May 21 10:21:06 2017 -0400

    Fix the mem_sec "small arena"
    
    Fix the small arena test to just check for the symptom of the infinite
    loop (i.e. initialized set on failure), rather than the actual infinite
    loop. This avoids some valgrind errors.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/3512)

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

Summary of changes:
 test/secmemtest.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/test/secmemtest.c b/test/secmemtest.c
index cb7d1ec..c7d4fe7 100644
--- a/test/secmemtest.c
+++ b/test/secmemtest.c
@@ -68,12 +68,15 @@ static int test_sec_mem(void)
     TEST_ptr_null(OPENSSL_secure_malloc((size_t)-1));
     TEST_true(CRYPTO_secure_malloc_done());
 
-    TEST_info("Possible infinite loop: small arena");
-    if (!TEST_false(CRYPTO_secure_malloc_init(16, 16)))
+    /*
+     * If init fails, then initialized should be false, if not, this
+     * could cause an infinite loop secure_malloc, but we don't test it
+     */
+    if (TEST_false(CRYPTO_secure_malloc_init(16, 16)) &&
+        !TEST_false(CRYPTO_secure_malloc_initialized())) {
+        TEST_true(CRYPTO_secure_malloc_done());
         goto end;
-    TEST_false(CRYPTO_secure_malloc_initialized());
-    TEST_ptr_null(OPENSSL_secure_malloc((size_t)-1));
-    TEST_true(CRYPTO_secure_malloc_done());
+    }
 
     /*-
      * There was also a possible infinite loop when the number of
@@ -105,7 +108,7 @@ static int test_sec_mem(void)
             TEST_true(CRYPTO_secure_malloc_done());
     }
 # endif
-    
+
     /* this can complete - it was not really secure */
     testresult = 1;
  end:


More information about the openssl-commits mailing list