Issue #3181 Add check for valid array index.

Change-Id: I8e0a37bdd094b341da2ce42922a16d840d1ab468

Former-commit-id: adf6d95c01 [formerly ca01934f9e9d355dd4159fd472e2aa9bc0918898]
Former-commit-id: a1f25b8748
This commit is contained in:
Roger Ferrel 2014-05-22 09:57:41 -05:00
parent a8ba16fc93
commit fb4ac9acc7

View file

@ -97,6 +97,7 @@ import com.raytheon.uf.common.util.FileUtil;
* populate the display label.
* Apr 01, 2014 2862 rferrel Moved purge only routines to ArchivePurgeManager.
* Apr 29, 2014 3036 rferrel Check for missing archive root directories.
* May 22, 2014 3181 rferrel Add check for valid array index.
* </pre>
*
* @author rferrel
@ -658,6 +659,14 @@ public class ArchiveConfigManager {
tmpDirs.clear();
int subExprIndex = 0;
/*
* Will never match when pattern's directories shorter then
* directories being scanned.
*/
if ((tokens.length - rootFileDepth) > subExpr.length) {
continue DIR_PATTERN_LOOP;
}
for (int i = rootFileDepth; i < tokens.length; i++) {
Pattern subPattern = Pattern.compile("^"
+ subExpr[subExprIndex++] + "$");