Skip to content

Commit

Permalink
🐛 fix DefectDojo#7690, microfocus webinspect NoneType Object
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-sommer committed Jan 14, 2024
1 parent 42548de commit 6845f8c
Show file tree
Hide file tree
Showing 3 changed files with 38,879 additions and 11 deletions.
20 changes: 9 additions & 11 deletions dojo/tools/microfocus_webinspect/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,13 @@ def get_findings(self, file, test):
cwe = 0
description = ""
classifications = issue.find("Classifications")
for content in classifications.findall("Classification"):
# detect CWE number
# TODO support more than one CWE number
if (
"kind" in content.attrib
and "CWE" == content.attrib["kind"]
):
cwe = MicrofocusWebinspectParser.get_cwe(
content.attrib["identifier"]
)
description += "\n\n" + content.text + "\n"
if classifications is not None:
for content in classifications.findall('Classification'):
# detect CWE number
# TODO support more than one CWE number
if "kind" in content.attrib and "CWE" == content.attrib["kind"]:
cwe = MicrofocusWebinspectParser.get_cwe(content.attrib['identifier'])
description += "\n\n" + content.text + "\n"

finding = Finding(
title=issue.findtext("Name"),
Expand Down Expand Up @@ -114,6 +110,8 @@ def convert_severity(val):
return "Medium"
elif val == "3":
return "High"
elif val == "4":
return "Critical"
else:
return "Info"

Expand Down
Loading

0 comments on commit 6845f8c

Please sign in to comment.