]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Use apr_isspace() instead of isspace() in cookie parsing
authorJoe Orton <jorton@apache.org>
Fri, 17 Jul 2026 13:58:04 +0000 (13:58 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 17 Jul 2026 13:58:04 +0000 (13:58 +0000)
* modules/proxy/mod_proxy_balancer.c (find_session_route): Replace
  isspace() with apr_isspace() to avoid locale-dependent behavior
  and undefined behavior with negative char values.

Submitted by: arshsmith1 <arshi bugqore.com>
GitHub: closes #675

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1936266 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_balancer.c

index bac659614e6ce3734583b2a921ee2023be3ba770..892bde38ae256c47dc2923b006b686b7084fa174 100644 (file)
@@ -171,10 +171,10 @@ static char *get_cookie_param(request_rec *r, const char *name)
             if (start_cookie == cookies ||
                 start_cookie[-1] == ';' ||
                 start_cookie[-1] == ',' ||
-                isspace(start_cookie[-1])) {
+                apr_isspace(start_cookie[-1])) {
 
                 start_cookie += strlen(name);
-                while(*start_cookie && isspace(*start_cookie))
+                while(*start_cookie && apr_isspace(*start_cookie))
                     ++start_cookie;
                 if (*start_cookie++ == '=' && *start_cookie) {
                     /*