]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
mod_proxy: Don't mangle r->filename when ap_proxy_canon_netloc() fails.
authorYann Ylavic <ylavic@apache.org>
Mon, 8 Jul 2024 14:25:58 +0000 (14:25 +0000)
committerYann Ylavic <ylavic@apache.org>
Mon, 8 Jul 2024 14:25:58 +0000 (14:25 +0000)
commitcf478ecb131e4133dc0ef6469438342d6049cc75
tree4a1c4338927e19c15209d04c6b7461950b21b976
parent6716ada174ed6bd8a6902164ab0bb2d7089d348f
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
modules/proxy/proxy_util.c