diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..bee8a64b79a99590d5303307144172cfe824fbf7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__ diff --git a/contrib/descriptions/cveproject.py b/contrib/descriptions/cveproject.py index c6ad24836834b8156d7d9950380dcf587beacdc6..4b816c912730513cd7aa06649e2cbab00159c573 100644 --- a/contrib/descriptions/cveproject.py +++ b/contrib/descriptions/cveproject.py @@ -29,8 +29,9 @@ class CveProjectProvider(VulnDescriptionProvider): response.raise_for_status() cve_json = response.json() description = cve_json['description']['description_data'][0]['value'] - self.cache[vuln] = description - return VulnDescription(description, self.nist_uri_template.format(vuln)) + vuln_description = VulnDescription(description, self.nist_uri_template.format(vuln)) + self.cache[vuln] = vuln_description + return vuln_description except HTTPError as he: return VulnDescription('', 'Description fetching error: ' + str(he)) diff --git a/contrib/parsers/flan_xml_parser.py b/contrib/parsers/flan_xml_parser.py index 7d88919b9498deffaf1f896148dd98c37c6f98a3..5254921b3e15ee8e946d8bcac5ab79bf21c54296 100644 --- a/contrib/parsers/flan_xml_parser.py +++ b/contrib/parsers/flan_xml_parser.py @@ -113,7 +113,7 @@ class FlanXmlParser: if not ip_addr: return - if host['status']['@state'] == 'up' and 'port' in host['ports']: + if host['status']['@state'] == 'up' and 'ports' in host.keys() and 'port' in host['ports']: ports = host['ports']['port'] if isinstance(ports, list): for p in ports: