ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r644043 - /ant/core/trunk/src/main/org/apache/tools/ant/util/GlobPatternMapper.java
Date Wed, 02 Apr 2008 20:37:25 GMT
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



Mime
View raw message