From 173f0a0e61139d721c203c12213d1a162eb545d4 Mon Sep 17 00:00:00 2001 From: Pauli Date: Tue, 22 Aug 2017 09:10:50 +1000 Subject: [PATCH] Use casts for arguments to ctype functions. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/4212) --- crypto/pem/pem_lib.c | 3 ++- ssl/ssl_ciph.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index c82b3c0ae2..865976bf8c 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -536,7 +536,8 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) ((c >= '0') && (c <= '9')))) break; #else - if (!(isupper(c) || (c == '-') || isdigit(c))) + if (!(isupper((unsigned char)c) || (c == '-') + || isdigit((unsigned char)c))) break; #endif header++; diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 40021329a9..ccdf00fa1b 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -1205,7 +1205,7 @@ static int ssl_cipher_process_rulestr(const char *rule_str, ((ch >= '0') && (ch <= '9')) || ((ch >= 'a') && (ch <= 'z')) || (ch == '-') || (ch == '.')) #else - while (isalnum(ch) || (ch == '-') || (ch == '.')) + while (isalnum((unsigned char)ch) || (ch == '-') || (ch == '.')) #endif { ch = *(++l); -- 2.25.1