diff options
author | Yann Ylavic <ylavic@apache.org> | 2024-07-08 16:25:58 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2024-07-08 16:25:58 +0200 |
commit | cf478ecb131e4133dc0ef6469438342d6049cc75 (patch) | |
tree | 4a1c4338927e19c15209d04c6b7461950b21b976 /modules | |
parent | mod_proxy: Fix canonicalisation and FCGI env (PATH_INFO, SCRIPT_NAME) for (diff) | |
download | apache2-cf478ecb131e4133dc0ef6469438342d6049cc75.tar.xz apache2-cf478ecb131e4133dc0ef6469438342d6049cc75.zip |
mod_proxy: Don't mangle r->filename when ap_proxy_canon_netloc() fails.
ap_proxy_canon_netloc() called from canon_handler hooks modifies its given
url in pace, hence &r->filename[6] passed from ap_proxy_canon_url().
This is not an issue if every canon_handler hook succeeds (or declines)
since r->filename is usually completely rewritten finally, but on failure
it gets truncated.
Avoid this by passing a copy of r->filename from the start, the proxy *url
and r->filename don't need to point to the same data.
* proxy/proxy_util.c(ap_proxy_canon_url):
Pass a copy of r->filename to the canon_handler hooks.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919023 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r-- | modules/proxy/proxy_util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index a8619197c4..39fc7010c7 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -2561,7 +2561,7 @@ PROXY_DECLARE(int) ap_proxy_canon_url(request_rec *r) } /* Keep this after fixup_uds_filename() */ - url = &r->filename[6]; + url = ap_pstrdup(r->pool, r->filename + 6); if ((dconf->interpolate_env == 1) && (r->proxyreq == PROXYREQ_REVERSE)) { /* create per-request copy of reverse proxy conf, |