Skip to content

Commit 65b93ce

Browse files
committed
Review finding by @Nicoretti
1 parent bf8e120 commit 65b93ce

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

exasol/toolbox/tools/security.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,17 @@ def gh_security_issues() -> Generator[Tuple[str, str], None, None]:
8787
def from_maven(report: str) -> Iterable[Issue]:
8888
# Note: Consider adding warnings if there is the same cve with multiple coordinates
8989
report = json.loads(report)
90-
if "vulnerable" in report:
91-
dependencies = report["vulnerable"] # type: ignore
92-
for _, dependency in dependencies.items(): # type: ignore
93-
for v in dependency["vulnerabilities"]: # type: ignore
94-
references = [v["reference"]] + v["externalReferences"]
95-
yield Issue(
96-
cve=v["cve"],
97-
cwe=v["cwe"],
98-
description=v["description"],
99-
coordinates=dependency["coordinates"],
100-
references=tuple(references),
101-
)
90+
dependencies = report.get("vulnerable", {}) # type: ignore
91+
for _, dependency in dependencies.items(): # type: ignore
92+
for v in dependency["vulnerabilities"]: # type: ignore
93+
references = [v["reference"]] + v["externalReferences"]
94+
yield Issue(
95+
cve=v["cve"],
96+
cwe=v["cwe"],
97+
description=v["description"],
98+
coordinates=dependency["coordinates"],
99+
references=tuple(references),
100+
)
102101

103102

104103
def security_issue_title(issue: Issue) -> str:

0 commit comments

Comments
 (0)