mirror of
https://github.com/hohn/sarif-cli.git
synced 2025-12-16 09:13:04 +01:00
Bugfix signature subset superset mismatch
when the template signature portion contains codeflows it was previously possible that a valid sarif problem portion that contains extra fields would be misdiagnosed as not parsable
This commit is contained in:
@@ -196,9 +196,14 @@ def _destructure_dict(typegraph: Typegraph, node, tree):
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
status_writer.unknown_sarif_parsing_shape["extra_info"] = "type fields {} do not match tree fields {}.".format(type_fields, tree_fields)
|
# possibly looks like: (Struct9699)type_fields: [codeflows...] vs tree_fields: [...extra_properties]
|
||||||
status_writer.csv_write(status_writer.unknown_sarif_parsing_shape)
|
# in that case we need to also try the Struct4055 signature here
|
||||||
raise Exception("typegraph: unhandled case reached: cannot match type "
|
if "codeFlows" in type_fields:
|
||||||
|
_destructure_dict(typegraph, "Struct4055", tree)
|
||||||
|
else:
|
||||||
|
status_writer.unknown_sarif_parsing_shape["extra_info"] = "type fields {} do not match tree fields {}.".format(type_fields, tree_fields)
|
||||||
|
status_writer.csv_write(status_writer.unknown_sarif_parsing_shape)
|
||||||
|
raise Exception("typegraph: unhandled case reached: cannot match type "
|
||||||
"fields {} to tree fields {}. Data is invalid."
|
"fields {} to tree fields {}. Data is invalid."
|
||||||
.format(type_fields, tree_fields))
|
.format(type_fields, tree_fields))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user