We need another guard, this may resolve a crash in the rather odd faux-server
implementation in mod_perl test suite which calls access checking too early.
Submitted by: wrowe
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1743575 13f79535-47bb-0310-9956-
ffa450edef68
updated patch with APLOGNOs by merging 1735931,1735935 from trunk
updated patch with APLOGNOs by merging 1735942 from trunk
- * Guard against premature invocation of ap_get_useragent_host()
- when the read_request hook has not satisfied r->useragent_addr;
- trunk patch: http://svn.apache.org/r1742135
- 2.4.x patch: trunk works
- +1: wrowe, rpluem, jim
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
int hostname_lookups;
int ignored_str_is_ip;
- if (r->useragent_addr == conn->client_addr) {
+ /* Guard here when examining the host before the read_request hook
+ * has populated an r->useragent_addr
+ */
+ if (!r->useragent_addr || (r->useragent_addr == conn->client_addr)) {
return ap_get_remote_host(conn, r->per_dir_config, type, str_is_ip);
}