OSDir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug 62344] New: Failing variable interpolation and memory allocation failure in ProxyHTMLURLMap


https://bz.apache.org/bugzilla/show_bug.cgi?id=62344

            Bug ID: 62344
           Summary: Failing variable interpolation and memory allocation
                    failure in ProxyHTMLURLMap
           Product: Apache httpd-2
           Version: 2.4.33
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy_html
          Assignee: bugs@xxxxxxxxxxxxxxxx
          Reporter: ewald@xxxxxxxxxxx
  Target Milestone: ---

Created attachment 35903
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35903&action=edit
Fix variable interpolation and memory allocation failure in ProxyHTMLURLMap

The attached file ProxyHTMLURLMap-memory-allocation-failure.patch fixes a
potential memory allocation failure in ProxyHTMLURLMap in conjunction with a
failed variable interpolation.

To reproduce, enable variable interpolation in ProxyHTMLURLMap and use a
pattern with a variable and the pipe symbol | after the variable. For example:

SetEnv env replaced
ProxyHTMLEnable On
ProxyHTMLInterp On
ProxyHTMLURLMap / /${env}_and_|/subfolder" V

The problem is that in mod_proxy_html.c, interpolate_var(), searching for |
isn't restricted to within the variable ${...}.

This leads to a wrong variable interpolation and, depending on your
environment, a memory allocation failure.

If you enable trace1 logging for mod_proxy_html you will see something like
this:

[...] mod_proxy_html.c(744): Interpolating env}_and_  =>  /subfolder"

The attached patch fixes this:

[...] mod_proxy_html.c(750): Interpolating env  =>  replaced

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: bugs-help@xxxxxxxxxxxxxxxx