Skip to content

Commit

Permalink
Fixing null reference in SARIF1012 validation (#2254)
Browse files Browse the repository at this point in the history
* Fixing null reference in SARIF1012 validation

* updating release history

Co-authored-by: Michael C. Fanning <michael.fanning@microsoft.com>
  • Loading branch information
eddynaka and michaelcfanning committed Jan 22, 2021
1 parent bdc9747 commit 6bd5d8d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/ReleaseHistory.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# SARIF Package Release History (SDK, Driver, Converters, and Multitool)

* BUGFIX: Fix NullReference in SARIF1012 rule validation [#2254](https://github.com/microsoft/sarif-sdk/pull/2254)

## **v2.3.17** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/2.3.17) | [Driver](https://www.nuget.org/packages/Sarif.Driver/2.3.17) | [Converters](https://www.nuget.org/packages/Sarif.Converters/2.3.17) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/2.3.17) | [Multitool Library](https://www.nuget.org/packages/Sarif.Multitool.Library/2.3.17)
* BREAKING: Move `CommandBase` class from `Multitool.Library` assembly to `Driver`. [#2238](https://github.com/microsoft/sarif-sdk/pull/2238)
* FEASTURE: Argument `VersionControlDetails` for `OptionallyEmittedData` in a analysis command will fill `VersionControlProvenance`. [#2237](https://github.com/microsoft/sarif-sdk/pull/2237)
* FEATURE: Argument `VersionControlDetails` for `OptionallyEmittedData` in a analysis command will fill `VersionControlProvenance`. [#2237](https://github.com/microsoft/sarif-sdk/pull/2237)

## **v2.3.16** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/2.3.16) | [Driver](https://www.nuget.org/packages/Sarif.Driver/2.3.16) | [Converters](https://www.nuget.org/packages/Sarif.Converters/2.3.16) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/2.3.16) | [Multitool Library](https://www.nuget.org/packages/Sarif.Multitool.Library/2.3.16)
* BREAKING: Rename flag `VersionControlInformation` to `VersionControlDetails` from `OptionallyEmittedData`. [#2222](https://github.com/microsoft/sarif-sdk/pull/2222)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected override void Analyze(Result result, string resultPointer)
result.Message.Id,
result.ResolvedRuleId(run) ?? "null",
numArgsRequired.ToString(),
result.Message.Arguments.Count.ToString());
(result.Message.Arguments?.Count ?? 0).ToString());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,37 @@
"ruleIndex": 0,
"level": "error",
"message": {
"id": "Error_MessageIdMustExist",
"id": "Error_SupplyEnoughMessageArguments",
"arguments": [
"runs[0].results[1]",
"DoesExist",
"TEST1001",
"2",
"0"
]
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"index": 0
},
"region": {
"startLine": 36,
"startColumn": 9
}
}
}
]
},
{
"ruleId": "SARIF1012",
"ruleIndex": 0,
"level": "error",
"message": {
"id": "Error_MessageIdMustExist",
"arguments": [
"runs[0].results[2]",
"DoesNotExist",
"TEST1001"
]
Expand All @@ -90,7 +118,7 @@
"index": 0
},
"region": {
"startLine": 36,
"startLine": 43,
"startColumn": 9
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
]
}
},
{
"ruleId": "TEST1001",
"ruleIndex": 0,
"message": {
"id": "DoesExist"
}
},
{
"ruleId": "TEST1001",
"ruleIndex": 0,
Expand Down

0 comments on commit 6bd5d8d

Please sign in to comment.