trailofbits / vscode-sarif-explorer

SARIF Explorer: A VSCode extension that helps you visualize and triage static analysis results
https://marketplace.visualstudio.com/items?itemName=trailofbits.sarif-explorer
GNU General Public License v3.0
21 stars 3 forks source link

URI paths on Windows not working #31

Open peterbrorsson opened 6 months ago

peterbrorsson commented 6 months ago

It seems like a file uri reference like this: file:///d:/sarif/demo.c does not work. This is the correct format according to https://datatracker.ietf.org/doc/html/rfc8089 and is also exemplified in the SARIF documentation (https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html) (just 'find' C:)

It seems like it works in this format: file://d:/sarif/demo.c // missing slash and file://d:\\sarif\\demo.c // missing slash and host path separator

Vasco-jofra commented 5 months ago

Thanks for the report! I haven't used SARIF Explorer on Windows, which is likely why this probably slipped through. I'll try to take a look at this soon. If you have a (non-confidential) SARIF file to reproduce the bug more easily, please share it. If not, I think I get there with your description as well.

micaelbo commented 5 days ago

I encounter the same problem. I get the message "Failed to open code region: SarifResultPathIsAbsolute: Result path is absolute but does not exist (/c:/wsl/sarif-test-960/Utilities.c). ..."

It seems the third "/" in "file:///" ends up in the path.

Example files attached.

sarif-test-960.zip