httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1583175 - /httpd/httpd/trunk/modules/mappers/mod_alias.c
Date Sun, 30 Mar 2014 18:20:09 GMT
Author: rjung
Date: Sun Mar 30 18:20:09 2014
New Revision: 1583175

URL: http://svn.apache.org/r1583175
Log:
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.

Modified:
    httpd/httpd/trunk/modules/mappers/mod_alias.c

Modified: httpd/httpd/trunk/modules/mappers/mod_alias.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_alias.c?rev=1583175&r1=1583174&r2=1583175&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_alias.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_alias.c Sun Mar 30 18:20:09 2014
@@ -371,15 +371,11 @@ static char *try_alias_list(request_rec 
                             }
                        }
                        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 {



Mime
View raw message