From: Nick Kew Date: Sat, 26 Dec 2009 10:30:52 +0000 (+0000) Subject: Fix r893871 as noted by rpluem, to remove risk of returning a X-Git-Tag: 2.3.5~64 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=103b68d409fc5c1a0ea601b82e2cc6a5dbc1e6d2;p=thirdparty%2Fapache%2Fhttpd.git Fix r893871 as noted by rpluem, to remove risk of returning a relative-ised URL, and fix erroneous CHANGES bug attribution. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@893955 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 4e35251412f..a5fba36efc9 100644 --- a/CHANGES +++ b/CHANGES @@ -30,8 +30,8 @@ Changes with Apache 2.3.5 ScanHTMLTitles, ReadmeName, HeaderName PR 48416 [Dmitry Bakshaev , Nick Kew] - *) Proxy: Fix ProxyPassReverse with relative URL. - PR 38864 [Nick Kew] + *) Proxy: Fix ProxyPassReverse with relative URL + Derived (slightly erroneously) from PR 38864 [Nick Kew] Changes with Apache 2.3.4 diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index d310d736864..72a951d5c9f 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1116,19 +1116,25 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, } } else { + const char *part = url; l2 = strlen(real); if (real[0] == '/') { - const char *part = strstr(url, "://"); + part = strstr(url, "://"); if (part) { - part = strstr(part+3, "/"); + part = strchr(part+3, '/'); if (part) { - url = part; - l1 = strlen(url); + l1 = strlen(part); } + else { + part = url; + } + } + else { + part = url; } } - if (l1 >= l2 && strncasecmp(real, url, l2) == 0) { - u = apr_pstrcat(r->pool, ent[i].fake, &url[l2], NULL); + if (l1 >= l2 && strncasecmp(real, part, l2) == 0) { + u = apr_pstrcat(r->pool, ent[i].fake, &part[l2], NULL); return ap_construct_url(r->pool, u, r); } }