Skip to content

Commit

Permalink
fix startColumn -1 in sarif format (#1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsKedar authored Nov 27, 2023
1 parent 23e96ae commit 3fefeec
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private void generateSastResults(ScanResults results, List<SarifVulnerability> r
Map<String, String> node = (Map<String, String>)result.get(pathNodeId.toString());
Integer line = (Integer.valueOf(Optional.ofNullable(node.get("line")).orElse("1")) == 0) ?
1 : Integer.valueOf(Optional.ofNullable(node.get("line")).orElse("1")); /* Sarif format does not support 0 as line number */
Integer col = (Integer.valueOf(Optional.ofNullable(node.get("column")).orElse("1")) == 0) ?
Integer col = (Integer.valueOf(Optional.ofNullable(node.get("column")).orElse("1")) <= 0) ?
1 : (Integer.valueOf(Optional.ofNullable(node.get("column")).orElse("1"))); /* Sarif format does not support 0 as column number */
Integer len = (Integer.valueOf(Optional.ofNullable(node.get("length")).orElse("1")) == 0) ?
1 : (Integer.valueOf(Optional.ofNullable(node.get("length")).orElse("1"))); /* Sarif format does not support 0 as column number */
Expand Down

0 comments on commit 3fefeec

Please sign in to comment.