]> granicus.if.org Git - apache/commitdiff
Merge r1742135 from trunk:
authorJim Jagielski <jim@apache.org>
Thu, 12 May 2016 21:27:47 +0000 (21:27 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 12 May 2016 21:27:47 +0000 (21:27 +0000)
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

STATUS
server/core.c

diff --git a/STATUS b/STATUS
index f2adea812fabbfada47a29fa2ec9757c23895034..59f1b2925aeee9a333e7b054211fe6783bc452ca 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -124,12 +124,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      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 ]
index 412ba34e59c355958445bf4b1f58679baf3b3cc7..a957807a09f4274f27f9b4b32fb8e7a9b7274a39 100644 (file)
@@ -975,7 +975,10 @@ AP_DECLARE(const char *) ap_get_useragent_host(request_rec *r,
     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);
     }