summaryrefslogtreecommitdiff
path: root/debian/patches/ap_get_useragent_host_modperl_crash.patch
blob: 2a3ec3d6ff09e59e5e87a841c1d71e8c0bba86f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# http://svn.apache.org/viewvc?view=revision&revision=1742135
--- apache2.orig/server/core.c
+++ apache2/server/core.c
@@ -966,7 +966,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);
     }