]> granicus.if.org Git - apache/commitdiff
We need another guard, this may resolve a crash in the rather odd faux-server
authorWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 3 May 2016 16:02:43 +0000 (16:02 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 3 May 2016 16:02:43 +0000 (16:02 +0000)
implementation in mod_perl test suite which calls access checking too early.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1742135 13f79535-47bb-0310-9956-ffa450edef68

server/core.c

index 5db957c394f6f22c370f742bdd3c8fd000b4f6b5..ed6014717000ca49e820e457f5ac98de9e33c05f 100644 (file)
@@ -1014,7 +1014,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);
     }