From: William A. Rowe Jr Date: Tue, 3 May 2016 16:02:43 +0000 (+0000) Subject: We need another guard, this may resolve a crash in the rather odd faux-server X-Git-Tag: 2.5.0-alpha~1657 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=195a2defa7aa0fdf5fb785109cf6d4c543b49494;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/server/core.c b/server/core.c index 5db957c394f..ed601471700 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); }