We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 97b9c43 commit d68e270Copy full SHA for d68e270
extensions/ql-vscode/src/common/sarif-parser.ts
@@ -40,7 +40,17 @@ export async function sarifParser(
40
});
41
42
asm.on("done", (asm) => {
43
- const log: Log = asm.current;
+ const log = asm.current;
44
+
45
+ // Do some trivial validation. This isn't a full validation of the SARIF file, but it's at
46
+ // least enough to ensure that we're not trying to parse complete garbage later.
47
+ if (log.runs === undefined || log.runs.length < 1) {
48
+ reject(
49
+ new Error(
50
+ "Invalid SARIF file: expecting at least one run with result.",
51
+ ),
52
+ );
53
+ }
54
55
resolve(log);
56
alreadyDone = true;
0 commit comments