]> granicus.if.org Git - apache/commitdiff
mod_proxy: Make sure we skip empty tokens when parsing the Connection
authorGraham Leggett <minfrin@apache.org>
Tue, 14 May 2013 20:16:59 +0000 (20:16 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 14 May 2013 20:16:59 +0000 (20:16 +0000)
header.

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

modules/proxy/proxy_util.c

index 2b2eb8296e9f38e20da4de637d87c5f27a9a5959..82c2cd02c74733954a2f6f63506f8ff58a35162a 100644 (file)
@@ -2982,8 +2982,11 @@ static int find_conn_headers(void *data, const char *key, const char *val)
     header_connection *x = data;
     const char *name;
 
-    name = ap_get_token(x->pool, &val, 0);
-    while (name && *name) {
+    do {
+        while (*val == ',') {
+            val++;
+        }
+        name = ap_get_token(x->pool, &val, 0);
         if (!strcasecmp(name, "close")) {
             x->closed = 1;
         }
@@ -2998,11 +3001,8 @@ static int find_conn_headers(void *data, const char *key, const char *val)
             elt = apr_array_push(x->array);
             *elt = name;
         }
-        while (*val == ',') {
-            ++val;
-        }
-        name = ap_get_token(x->pool, &val, 0);
-    }
+    } while (*val);
+
     return 1;
 }