Skip to content

Commit 4964eff

Browse files
fix: check if 'type' is in severity for the OSV source (#5240)
* fix: check if 'type' is in severity for the OSV source * fix: satisfy black linter requirement --------- Co-authored-by: Sanskar Sharma <[email protected]>
1 parent ed4d442 commit 4964eff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cve_bin_tool/data_sources/osv_source.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ def format_data(self, all_cve_entries):
263263

264264
# getting score
265265
# OSV Schema currently only provides CVSS V3 scores, though more scores may be added in the future
266-
if severity is not None and "CVSS_V3" in [x["type"] for x in severity]:
266+
if severity is not None and "CVSS_V3" in [
267+
x["type"] for x in severity if isinstance(x, dict) and "type" in x
268+
]:
267269
try:
268270
# Ensure CVSS vector is valid
269271
if severity[0]["score"].endswith("/"):

0 commit comments

Comments
 (0)