]> granicus.if.org Git - apache/commitdiff
Fix segfault in mod_alias introduced in r1132494.
authorRainer Jung <rjung@apache.org>
Sun, 30 Mar 2014 18:20:09 +0000 (18:20 +0000)
committerRainer Jung <rjung@apache.org>
Sun, 30 Mar 2014 18:20:09 +0000 (18:20 +0000)
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

modules/mappers/mod_alias.c

index 0740cef0bf1506e4f54e0b08d0f12b49fd901e8e..31d2b700943d67f213ea8ff9735c7d23dea55fc1 100644 (file)
@@ -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 {