From: Graham Leggett Date: Tue, 14 May 2013 20:16:59 +0000 (+0000) Subject: mod_proxy: Make sure we skip empty tokens when parsing the Connection X-Git-Tag: 2.5.0-alpha~5455 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d21bdf4dea3c17dede920ac1e5da1f95669b7a30;p=apache mod_proxy: Make sure we skip empty tokens when parsing the Connection header. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1482555 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 2b2eb8296e..82c2cd02c7 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -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; }