From: Rainer Jung Date: Sun, 30 Mar 2014 18:20:09 +0000 (+0000) Subject: Fix segfault in mod_alias introduced in r1132494. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3fb9053316324cb956b2bf54ef9370dcb176d67;p=thirdparty%2Fapache%2Fhttpd.git Fix segfault in mod_alias introduced in r1132494. AliasMatch does not append unmatched parts of the original URI to the new URI. So no need to subtract anything from the new URI length. The existing code crashed when using "AliasMatch / /some/thing" and sending a request with a long URI. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1583175 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_alias.c b/modules/mappers/mod_alias.c index 0740cef0bf1..31d2b700943 100644 --- a/modules/mappers/mod_alias.c +++ b/modules/mappers/mod_alias.c @@ -371,15 +371,11 @@ static char *try_alias_list(request_rec *r, apr_array_header_t *aliases, } } else { - int pathlen = strlen(found) - - (strlen(r->uri + regm[0].rm_eo)); - AP_DEBUG_ASSERT(pathlen >= 0); - AP_DEBUG_ASSERT(pathlen <= strlen(found)); ap_set_context_info(r, apr_pstrmemdup(r->pool, r->uri, regm[0].rm_eo), apr_pstrmemdup(r->pool, found, - pathlen)); + strlen(found))); } } else {