You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by pe...@apache.org on 2008/04/02 22:37:25 UTC

svn commit: r644043 - /ant/core/trunk/src/main/org/apache/tools/ant/util/GlobPatternMapper.java

Author: peterreilly
Date: Wed Apr  2 13:37:25 2008
New Revision: 644043

URL: http://svn.apache.org/viewvc?rev=644043&view=rev
Log:
bugzilla 44731: index out of bound in globmapper (due to overlap)

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/util/GlobPatternMapper.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/GlobPatternMapper.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/GlobPatternMapper.java?rev=644043&r1=644042&r2=644043&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/GlobPatternMapper.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/GlobPatternMapper.java Wed Apr  2 13:37:25 2008
@@ -132,7 +132,9 @@
     public String[] mapFileName(String sourceFileName) {
         if (fromPrefix == null
             || !modifyName(sourceFileName).startsWith(modifyName(fromPrefix))
-            || !modifyName(sourceFileName).endsWith(modifyName(fromPostfix))) {
+            || !modifyName(sourceFileName).endsWith(modifyName(fromPostfix))
+            || (sourceFileName.length() < (prefixLength + postfixLength))
+            ) {
             return null;
         }
         return new String[] {toPrefix