From: Rainer Jung Date: Sun, 30 Mar 2014 18:20:09 +0000 (+0000) Subject: Fix segfault in mod_alias introduced in r1132494. X-Git-Tag: 2.5.0-alpha~4371 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ac4515e6045c5f8b79d964b16c2a107c1c8162d;p=apache 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 0740cef0bf..31d2b70094 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 {