From ed00e66a2affceadeca78d8766817c2195b40264 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 12 Jan 2015 13:59:22 +0000 Subject: [PATCH] Merge r1648433 from trunk: PR 56603: Inappropiate ProxyPassReverse match when interpolated URL is empty string Submitted By: Committed By: covener Submitted by: covener Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1651094 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ STATUS | 6 ------ modules/proxy/proxy_util.c | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index bc1cca8d0e..5cfa3c86a4 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,10 @@ Changes with Apache 2.4.11 request headers earlier. Adds "MergeTrailers" directive to restore legacy behavior. [Edward Lu, Yann Ylavic, Joe Orton, Eric Covener] + *) mod_proxy: Prevent ProxyPassReverse from doing a substitution when + the URL parameter interpolates to an empty string. PR 56603. + [] + *) core: Fix -D[efined] or [d] variables lifetime accross restarts. PR 57328. [Armin Abfalterer , Yann Ylavic]. diff --git a/STATUS b/STATUS index c7207a1e0a..378d273fc2 100644 --- a/STATUS +++ b/STATUS @@ -110,12 +110,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: 2.4.x patch: https://issues.apache.org/bugzilla/attachment.cgi?id=32209 +1: druggeri, gsmith, rjung - * mod_proxy: Inappropiate ProxyPassReverse match when interpolated URL is - empty string. PR56603 - trunk patch: http://svn.apache.org/r1648433 - 2.4.x patch: trunk works - +1 covener, rjung, jim - * split-logfile: Fix perl strict refs error PR56329. trunk patch: 1648719 2.4.x patch: trunks works diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 9d8265a293..5809c02094 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -940,7 +940,7 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, part = url; } } - if (l1 >= l2 && strncasecmp(real, part, l2) == 0) { + if (l2 > 0 && l1 >= l2 && strncasecmp(real, part, l2) == 0) { u = apr_pstrcat(r->pool, ent[i].fake, &part[l2], NULL); return ap_is_url(u) ? u : ap_construct_url(r->pool, u, r); } -- 2.40.0