[openssl-commits] [openssl] master update

paul.dale at oracle.com paul.dale at oracle.com
Mon Aug 21 21:35:02 UTC 2017


The branch master has been updated
       via  00dfbaad88a69ed8294d6039bf5f7d722f72bf39 (commit)
      from  0d68367a1279a369146661f4857816b2044116b4 (commit)


- Log -----------------------------------------------------------------
commit 00dfbaad88a69ed8294d6039bf5f7d722f72bf39
Author: Pauli <paul.dale at oracle.com>
Date:   Mon Aug 21 07:36:23 2017 +1000

    Fix ctype arguments.
    
    Cast arguments to the various ctype functions to unsigned char to match their
    documentation.
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4203)

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

Summary of changes:
 apps/opt.c                    | 2 +-
 apps/rehash.c                 | 2 +-
 ssl/ssl_ciph.c                | 3 ++-
 test/ecstresstest.c           | 2 +-
 test/evp_test.c               | 2 +-
 test/testutil/format_output.c | 4 ++--
 test/testutil/stanza.c        | 4 ++--
 7 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/apps/opt.c b/apps/opt.c
index 72d0c53..40d6a27 100644
--- a/apps/opt.c
+++ b/apps/opt.c
@@ -61,7 +61,7 @@ char *opt_progname(const char *argv0)
     if (n > sizeof prog - 1)
         n = sizeof prog - 1;
     for (q = prog, i = 0; i < n; i++, p++)
-        *q++ = isupper(*p) ? tolower(*p) : *p;
+        *q++ = tolower((unsigned char)*p);
     *q = '\0';
     return prog;
 }
diff --git a/apps/rehash.c b/apps/rehash.c
index ad7108a..8bb9a14 100644
--- a/apps/rehash.c
+++ b/apps/rehash.c
@@ -300,7 +300,7 @@ static int massage_filename(char *name)
 
     if (q != NULL) {
         for (q++; *q != '\0'; q++) {
-            if (!isdigit(*q))
+            if (!isdigit((unsigned char)*q))
                 return 1;
         }
     }
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index 914d0d8..60e1308 100644
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -1001,7 +1001,8 @@ static int ssl_cipher_process_rulestr(const char *rule_str,
                    ((ch >= 'a') && (ch <= 'z')) ||
                    (ch == '-') || (ch == '.') || (ch == '='))
 #else
-            while (isalnum(ch) || (ch == '-') || (ch == '.') || (ch == '='))
+            while (isalnum((unsigned char)ch) || (ch == '-') || (ch == '.')
+                   || (ch == '='))
 #endif
             {
                 ch = *(++l);
diff --git a/test/ecstresstest.c b/test/ecstresstest.c
index 7c76f02..b47095c 100644
--- a/test/ecstresstest.c
+++ b/test/ecstresstest.c
@@ -109,7 +109,7 @@ static int atoi64(const char *in, int64_t *result)
     for ( ; *in != '\0'; in++) {
         char c = *in;
 
-        if (!isdigit(c))
+        if (!isdigit((unsigned char)c))
             return 0;
         ret *= 10;
         ret += (c - '0');
diff --git a/test/evp_test.c b/test/evp_test.c
index 3875081..9de7fcc 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -1302,7 +1302,7 @@ static int parse_uint64(const char *value, uint64_t *pr)
             return -1;
         }
         *pr *= 10;
-        if (!TEST_true(isdigit(*p))) {
+        if (!TEST_true(isdigit((unsigned char)*p))) {
             TEST_error("Invalid character in string %s", value);
             return -1;
         }
diff --git a/test/testutil/format_output.c b/test/testutil/format_output.c
index 13123d5..9b04a94 100644
--- a/test/testutil/format_output.c
+++ b/test/testutil/format_output.c
@@ -72,12 +72,12 @@ static void test_fail_string_common(const char *prefix, const char *file,
         if (l1 > 0) {
             b1[n1 = l1 > width ? width : l1] = 0;
             for (i = 0; i < n1; i++)
-                b1[i] = isprint(m1[i]) ? m1[i] : '.';
+                b1[i] = isprint((unsigned char)m1[i]) ? m1[i] : '.';
         }
         if (l2 > 0) {
             b2[n2 = l2 > width ? width : l2] = 0;
             for (i = 0; i < n2; i++)
-                b2[i] = isprint(m2[i]) ? m2[i] : '.';
+                b2[i] = isprint((unsigned char)m2[i]) ? m2[i] : '.';
         }
         diff = 0;
         i = 0;
diff --git a/test/testutil/stanza.c b/test/testutil/stanza.c
index 3596752..09fc181 100644
--- a/test/testutil/stanza.c
+++ b/test/testutil/stanza.c
@@ -70,12 +70,12 @@ static char *strip_spaces(char *p)
     char *q;
 
     /* Skip over leading spaces */
-    while (*p && isspace(*p))
+    while (*p && isspace((unsigned char)*p))
         p++;
     if (!*p)
         return NULL;
 
-    for (q = p + strlen(p) - 1; q != p && isspace(*q); )
+    for (q = p + strlen(p) - 1; q != p && isspace((unsigned char)*q); )
         *q-- = '\0';
     return *p ? p : NULL;
 }


More information about the openssl-commits mailing list