From 195a2defa7aa0fdf5fb785109cf6d4c543b49494 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 3 May 2016 16:02:43 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1742135 13f79535-47bb-0310-9956-ffa450edef68 --- server/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/core.c b/server/core.c index 5db957c394..ed60147170 100644 --- a/server/core.c +++ b/server/core.c @@ -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); } -- 2.50.1