microsoft / sarif-tools

A set of Python command line tools for working with SARIF files produced by code analysis tools
MIT License
76 stars 19 forks source link

Does not seem to parse artifactLocation.index properly #6

Closed Tubbles closed 10 months ago

Tubbles commented 2 years ago

I am trying to parse a sarif file which employs the artifactLocation.index in its result listing, which seems to make this tool crash. https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317432 . Please let me know if this tool should be able to parse this syntax and if I might be doing something wrong

jeffp-seequent commented 1 year ago

I can confirm. Files output from Visual Studio's native code (PREFast) utilize the 'index' field of the artifactLocation. These tools do not parse the 'index' field and instead throw something akin to the following.

ValueError: No location in C6385 output from PREfast

balgillo commented 10 months ago

I've tested that example in sarif-tools 1.0. After correcting the syntax error "region: { to "region": { in the example JSON, sarif-tools parses the location fine. So, I think this was fixed priori to 1.0 release. Closing issue.