[openssl-commits] [openssl] master update

paul.dale at oracle.com paul.dale at oracle.com
Thu Aug 24 21:56:24 UTC 2017


The branch master has been updated
       via  da9b249fd994124e954d871ff220cc2c0ddf9e6a (commit)
      from  0f3ffbd1581fad58095fedcc32b0da42a486b8b7 (commit)


- Log -----------------------------------------------------------------
commit da9b249fd994124e954d871ff220cc2c0ddf9e6a
Author: Pauli <paul.dale at oracle.com>
Date:   Wed Aug 23 08:10:31 2017 +1000

    Check range of test values using isascii before diving into the full
    range of ctype functions.
    
    Revert "Don't try to compare the ctype functions on values > 127"
    This reverts commit 6ac589081b53a62bff5f0abe62c1c109c419c7a0.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4225)

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

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

diff --git a/test/ctype_internal_test.c b/test/ctype_internal_test.c
index 04ab14d..ce3cbfe 100644
--- a/test/ctype_internal_test.c
+++ b/test/ctype_internal_test.c
@@ -27,9 +27,14 @@ static int isblank(int c)
 
 static int test_ctype_chars(int n)
 {
-    return TEST_int_eq(isalnum(n) != 0, ossl_isalnum(n) != 0)
-           && TEST_int_eq(isalpha(n) != 0, ossl_isalpha(n) != 0)
-           && TEST_int_eq(isascii(n) != 0, ossl_isascii(n) != 0)
+    if (!TEST_int_eq(isascii((unsigned char)n) != 0, ossl_isascii(n) != 0))
+        return 0;
+
+    if (!ossl_isascii(n))
+        return 1;
+
+    return TEST_int_eq(isalpha(n) != 0, ossl_isalpha(n) != 0)
+           && TEST_int_eq(isalnum(n) != 0, ossl_isalnum(n) != 0)
            && TEST_int_eq(isblank(n) != 0, ossl_isblank(n) != 0)
            && TEST_int_eq(iscntrl(n) != 0, ossl_iscntrl(n) != 0)
            && TEST_int_eq(isdigit(n) != 0, ossl_isdigit(n) != 0)
@@ -75,7 +80,7 @@ static int test_ctype_eof(void)
 
 int setup_tests(void)
 {
-    ADD_ALL_TESTS(test_ctype_chars, 128);
+    ADD_ALL_TESTS(test_ctype_chars, 256);
     ADD_ALL_TESTS(test_ctype_toupper, OSSL_NELEM(case_change));
     ADD_ALL_TESTS(test_ctype_tolower, OSSL_NELEM(case_change));
     ADD_TEST(test_ctype_eof);


More information about the openssl-commits mailing list