Skip to content

Commit d0e25a2

Browse files
committed
Merge pull request #1 from ErezYalon/ErezYalon-patch-1
Update CheckmarxReader.java
2 parents 0e65a41 + 79e93e6 commit d0e25a2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/org/owasp/benchmark/score/parsers/CheckmarxReader.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,12 @@ private TestCaseResult parseCheckmarxVulnerability(Node query, Node result) {
121121
return null;
122122
}
123123

124-
//In the output xml file from Checkmarx there is no attribute on the node "query" named SeverityIndex
125-
//tcr.setConfidence( Integer.parseInt( getAttributeValue( "SeverityIndex", result) ) );
124+
//Output xml file from Checkmarx (depends on version) sometimes does not
125+
//contain attribute on the node "query" named SeverityIndex
126+
String SeverityIndex = getAttributeValue( "SeverityIndex", result);
127+
if(SeverityIndex != null && !SeverityIndex.equals("")) {
128+
tcr.setConfidence( Integer.parseInt( getAttributeValue( "SeverityIndex", result) ) );
129+
}
126130

127131
tcr.setEvidence( getAttributeValue( "name", query ) );
128132

0 commit comments

Comments
 (0)