You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2016/05/03 18:02:43 UTC

svn commit: r1742135 - /httpd/httpd/trunk/server/core.c

Author: wrowe
Date: Tue May  3 16:02:43 2016
New Revision: 1742135

URL: http://svn.apache.org/viewvc?rev=1742135&view=rev
Log:
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.


Modified:
    httpd/httpd/trunk/server/core.c

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=1742135&r1=1742134&r2=1742135&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Tue May  3 16:02:43 2016
@@ -1014,7 +1014,10 @@ AP_DECLARE(const char *) ap_get_useragen
     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);
     }