diff options
author | Michael Baentsch <57787676+baentsch@users.noreply.github.com> | 2023-06-08 08:05:42 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-06-09 17:33:04 +0200 |
commit | fefeecf00dd75a44dc33569f857aa741f59ccbb4 (patch) | |
tree | 733d11752f1308c314941cef1ef1c4c64f630307 /apps | |
parent | 3fbb364b192c3568947d5e164cc29ebe6f992205 (diff) |
Cast the argument to unsigned char when calling isspace()
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21151)
(cherry picked from commit 8a2e74d0536c91585fbe789e0ab7b06cab0289c2)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/cmp.c | 4 | ||||
-rw-r--r-- | apps/lib/apps.c | 4 | ||||
-rw-r--r-- | apps/req.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/apps/cmp.c b/apps/cmp.c index 3463579c24..4c3b29eba5 100644 --- a/apps/cmp.c +++ b/apps/cmp.c @@ -2115,7 +2115,7 @@ static const char *prev_item(const char *opt, const char *end) beg = end; while (beg > opt) { --beg; - if (beg[0] == ',' || isspace(beg[0])) { + if (beg[0] == ',' || isspace(_UC(beg[0]))) { ++beg; break; } @@ -2130,7 +2130,7 @@ static const char *prev_item(const char *opt, const char *end) opt_item[len] = '\0'; while (beg > opt) { --beg; - if (beg[0] != ',' && !isspace(beg[0])) { + if (beg[0] != ',' && !isspace(_UC(beg[0]))) { ++beg; break; } diff --git a/apps/lib/apps.c b/apps/lib/apps.c index 79afa1deab..0ac828fdf5 100644 --- a/apps/lib/apps.c +++ b/apps/lib/apps.c @@ -638,13 +638,13 @@ void *app_malloc(size_t sz, const char *what) char *next_item(char *opt) /* in list separated by comma and/or space */ { /* advance to separator (comma or whitespace), if any */ - while (*opt != ',' && !isspace(*opt) && *opt != '\0') + while (*opt != ',' && !isspace(_UC(*opt)) && *opt != '\0') opt++; if (*opt != '\0') { /* terminate current item */ *opt++ = '\0'; /* skip over any whitespace after separator */ - while (isspace(*opt)) + while (isspace(_UC(*opt))) opt++; } return *opt == '\0' ? NULL : opt; /* NULL indicates end of input */ diff --git a/apps/req.c b/apps/req.c index 23757044ab..4b4e36c68a 100644 --- a/apps/req.c +++ b/apps/req.c @@ -199,7 +199,7 @@ static int duplicated(LHASH_OF(OPENSSL_STRING) *addexts, char *kv) /* Check syntax. */ /* Skip leading whitespace, make a copy. */ - while (*kv && isspace(*kv)) + while (*kv && isspace(_UC(*kv))) if (*++kv == '\0') return 1; if ((p = strchr(kv, '=')) == NULL) @@ -210,7 +210,7 @@ static int duplicated(LHASH_OF(OPENSSL_STRING) *addexts, char *kv) /* Skip trailing space before the equal sign. */ for (p = kv + off; p > kv; --p) - if (!isspace(p[-1])) + if (!isspace(_UC(p[-1]))) break; if (p == kv) { OPENSSL_free(kv); |