mirror of https://github.com/apache/maven.git
Adding defensive code for one more place where cleanedPath length could cause a problem with string manipulation in appendPath(..).
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@382861 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
138d77d3b0
commit
4c85dfc331
|
@ -482,6 +482,7 @@ public class DefaultModelInheritanceAssembler
|
||||||
return repository;
|
return repository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: This should eventually be migrated to DefaultPathTranslator.
|
||||||
protected String appendPath( String parentPath, String childPath, String pathAdjustment, boolean appendPaths )
|
protected String appendPath( String parentPath, String childPath, String pathAdjustment, boolean appendPaths )
|
||||||
{
|
{
|
||||||
List pathFragments = new ArrayList();
|
List pathFragments = new ArrayList();
|
||||||
|
@ -570,7 +571,12 @@ public class DefaultModelInheritanceAssembler
|
||||||
|
|
||||||
if ( appendPaths && lastPathPart != null && !lastPathPart.endsWith( "/" ) )
|
if ( appendPaths && lastPathPart != null && !lastPathPart.endsWith( "/" ) )
|
||||||
{
|
{
|
||||||
cleanedPath.setLength( cleanedPath.length() - 1 );
|
int cleanedPathLen = cleanedPath.length();
|
||||||
|
|
||||||
|
if ( cleanedPathLen > 0 )
|
||||||
|
{
|
||||||
|
cleanedPath.setLength( cleanedPathLen - 1 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return cleanedPath.toString();
|
return cleanedPath.toString();
|
||||||
|
|
Loading…
Reference in New Issue