Skip to content

Commit

Permalink
Additional fix for BZ 58660
Browse files Browse the repository at this point in the history
When Mapper root redirect is enabled, ensure '/' is added to path for redirect
This is part 3 of 3 of the fix for CVE-2015-5345

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1716894 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Nov 27, 2015
1 parent f388800 commit 127d8ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion java/org/apache/catalina/mapper/Mapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -879,8 +879,10 @@ private final void internalMapWrapper(ContextVersion contextVersion,
if(mappingData.wrapper == null && noServletPath &&
mappingData.context.getMapperContextRootRedirectEnabled()) {
// The path is empty, redirect to "/"
path.append('/');
pathEnd = path.getEnd();
mappingData.redirectPath.setChars
(path.getBuffer(), pathOffset, pathEnd-pathOffset);
(path.getBuffer(), pathOffset, pathEnd - pathOffset);
path.setEnd(pathEnd - 1);
return;
}
Expand Down

0 comments on commit 127d8ea

Please # to comment.