fix(perf): reject malformed PCAP provenance before grading
Parse present summary/page containers independently of the claimed kind so malformed nested values write failed facts rather than crashing. Validate outer limitations as arrays of strings before producing observations and admitting citations. Preserve empty valid lists and original measurements. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
This commit is contained in:
committed by
morluto
co-authored by
factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Kaoru0822
parent
0f24c61196
commit
620ac0f5a7
@@ -191,10 +191,11 @@ def main():
|
||||
continue
|
||||
identity = value['evidence_id']
|
||||
normalized = value.get('normalized_result')
|
||||
supported = isinstance(normalized, dict) and isinstance(value.get('limitations'), list)
|
||||
if supported and normalized.get('kind') == 'summary':
|
||||
supported = (isinstance(normalized, dict) and isinstance(value.get('limitations'), list)
|
||||
and all(isinstance(item, str) for item in value['limitations']))
|
||||
if supported and ('summary' in normalized or normalized.get('kind') == 'summary'):
|
||||
supported = isinstance(normalized.get('summary'), dict)
|
||||
elif supported and normalized.get('kind') == 'pcap':
|
||||
if supported and ('page' in normalized or normalized.get('kind') == 'pcap'):
|
||||
supported = isinstance(normalized.get('page'), dict)
|
||||
entry = (tool, arguments, value) if supported else None
|
||||
if identity not in records:
|
||||
|
||||
Reference in New Issue
Block a user