1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-23 02:50:08 +03:00

nanohttp: Avoid ctype(3) misuse.

fix https://gitlab.gnome.org/GNOME/libxml2/-/issues/780
This commit is contained in:
Taylor R Campbell 2024-08-06 22:34:29 +00:00 committed by Nick Wellnhofer
parent 1d009fe35d
commit b45a0f0eca

View File

@ -1257,7 +1257,8 @@ xmlNanoHTTPHostnameMatch(const char *pattern, const char *hostname) {
for (; idx_pattern >= 0 && idx_hostname >= 0;
--idx_pattern, --idx_hostname) {
if (tolower(pattern_start[idx_pattern]) != tolower(hostname[idx_hostname]))
if (tolower((unsigned char)pattern_start[idx_pattern]) !=
tolower((unsigned char)hostname[idx_hostname]))
break;
}
@ -1289,7 +1290,7 @@ xmlNanoHTTPBypassProxy(const char *hostname) {
env = cpy;
/* The remainder of the function is basically a tokenizing: */
while (isspace(*env))
while (isspace((unsigned char)*env))
++env;
if (*env == '\0') {
xmlFree(cpy);
@ -1310,7 +1311,7 @@ xmlNanoHTTPBypassProxy(const char *hostname) {
return 1;
}
while (isspace(*env))
while (isspace((unsigned char)*env))
++env;
p = env;
}