From: Jim Jagielski Date: Thu, 12 May 2016 21:27:47 +0000 (+0000) Subject: Merge r1742135 from trunk: X-Git-Tag: 2.4.21~178 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb02397dfe35aa40dcd2e437d6bf0118f1db68f5;p=apache Merge r1742135 from trunk: 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. Submitted by: wrowe Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1743575 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index f2adea812f..59f1b2925a 100644 --- a/STATUS +++ b/STATUS @@ -124,12 +124,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: updated patch with APLOGNOs by merging 1735931,1735935 from trunk updated patch with APLOGNOs by merging 1735942 from trunk - * Guard against premature invocation of ap_get_useragent_host() - when the read_request hook has not satisfied r->useragent_addr; - trunk patch: http://svn.apache.org/r1742135 - 2.4.x patch: trunk works - +1: wrowe, rpluem, jim - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/server/core.c b/server/core.c index 412ba34e59..a957807a09 100644 --- a/server/core.c +++ b/server/core.c @@ -975,7 +975,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); }