fix index out of range exception per issue #611

This commit is contained in:
Jeremy Long
2016-11-11 10:58:14 -05:00
parent e0b549e427
commit 3bbc485968

View File

@@ -734,11 +734,11 @@ public class JarAnalyzer extends AbstractFileTypeAnalyzer {
} }
} else if ("build-id".equals(key)) { } else if ("build-id".equals(key)) {
int pos = value.indexOf('('); int pos = value.indexOf('(');
if (pos >= 0) { if (pos > 0) {
value = value.substring(0, pos - 1); value = value.substring(0, pos - 1);
} }
pos = value.indexOf('['); pos = value.indexOf('[');
if (pos >= 0) { if (pos > 0 ) {
value = value.substring(0, pos - 1); value = value.substring(0, pos - 1);
} }
versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM); versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);