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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8b950f566578971f5b63bafdd26b1b88b9d670c;p=thirdparty%2Fapache%2Fhttpd.git 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 2b2eb8296e9..82c2cd02c74 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; }