From 6e8c394d6b447db8bdac21211cf75b1f4e2be85b Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 19 Jun 2018 13:14:38 +0000 Subject: [PATCH] Merge r1830746 from trunk: mod_proxy_html: Fix variable interpolation and memory allocation failure in ProxyHTMLURLMap. Proposed by: Ewald Dieterich Reviewed by: ylavic Submitted by: ylavic Reviewed by: ylavic, jailletc36, jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1833840 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ STATUS | 7 ------- modules/filters/mod_proxy_html.c | 6 ++++++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index ccb2838d63..3e00881fde 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.4.34 + *) mod_proxy_html: Fix variable interpolation and memory allocation failure + in ProxyHTMLURLMap. [Ewald Dieterich ] + *) mod_remoteip: Fix RemoteIP{Trusted,Internal}ProxyList loading broken by 2.4.30. PR 62220. [Chritophe Jaillet, Yann Ylavic] diff --git a/STATUS b/STATUS index 46927f3119..52d2f28389 100644 --- a/STATUS +++ b/STATUS @@ -141,13 +141,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - *) mod_proxy_html: Fix variable interpolation and memory allocation failure - in ProxyHTMLURLMap. PR 62344. - trunk patch: http://svn.apache.org/r1830746 - 2.4.x patch: svn merge -c 1830746 ^/httpd/httpd/trunk . - (trunk works modulo CHANGES)) - +1: ylavic, jailletc36, jim - *) http: Fix small memory leak per request when handling persistent connections trunk patch: http://svn.apache.org/r1833014 2.4.x patch: trunk works (modulo CHANGES) diff --git a/modules/filters/mod_proxy_html.c b/modules/filters/mod_proxy_html.c index 78ebdab34e..7658fa3c61 100644 --- a/modules/filters/mod_proxy_html.c +++ b/modules/filters/mod_proxy_html.c @@ -724,6 +724,12 @@ static const char *interpolate_vars(request_rec *r, const char *str) break; delim = ap_strchr_c(start, '|'); + + /* Restrict delim to ${...} */ + if (delim && delim >= end) { + delim = NULL; + } + before = apr_pstrndup(r->pool, str, start-str); after = end+1; if (delim) { -- 2.40.0