diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java index 5acbf5206..02363842e 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java @@ -422,17 +422,6 @@ public class CPEAnalyzer implements Analyzer { * @return whether or not the EvidenceCollection contains the string */ private boolean collectionContainsString(EvidenceCollection ec, String text) { - - // - // String[] splitText = text.split("[\\s_-]"); - // - // for (String search : splitText) { - // //final String search = text.replaceAll("[\\s_-]", "").toLowerCase(); - // if (ec.containsUsedString(search)) { - // return true; - // } - // } - // //TODO - likely need to change the split... not sure if this will work for CPE with special chars if (text == null) { return false; @@ -454,9 +443,16 @@ public class CPEAnalyzer implements Analyzer { list.add(word); } } - if (tempWord != null && !list.isEmpty()) { - final String tmp = list.get(list.size() - 1) + tempWord; - list.add(tmp); + if (tempWord != null) { + if (!list.isEmpty()) { + final String tmp = list.get(list.size() - 1) + tempWord; + list.add(tmp); + } else { + list.add(tempWord); + } + } + if (list.isEmpty()) { + return false; } boolean contains = true; for (String word : list) {