From: Pauli Date: Sun, 20 Aug 2017 21:36:23 +0000 (+1000) Subject: Fix ctype arguments. X-Git-Tag: OpenSSL_1_1_0g~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=603e5170161bd71d2341c34fdcca24d191964c0d;p=openssl Fix ctype arguments. Cast arguments to the various ctype functions to unsigned char to match their documentation. Reviewed-by: Andy Polyakov (Merged from https://github.com/openssl/openssl/pull/4203) (cherry picked from commit 00dfbaad88a69ed8294d6039bf5f7d722f72bf39) --- diff --git a/apps/opt.c b/apps/opt.c index f72ac64ec7..4c3a26e5a7 100644 --- a/apps/opt.c +++ b/apps/opt.c @@ -63,7 +63,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 2b517be9f4..273ad74969 100644 --- a/apps/rehash.c +++ b/apps/rehash.c @@ -305,7 +305,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 dad2ec176d..da6e298435 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -1036,7 +1036,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);