[PATCH 46 of 54] CVE: Handle the case where gsa has no result

Wald Commits scm-commit at wald.intevation.org
Wed Jan 7 10:57:03 CET 2015


# HG changeset patch
# User Benoît Allard <benoit.allard at greenbone.net>
# Date 1419938289 -3600
# Node ID 0755199759334e053a3b94f44b3965d6dcb1c8fe
# Parent  b7e64d0a3a7c297c9de458828ccce067b46db220
CVE: Handle the case where gsa has no result

diff -r b7e64d0a3a7c -r 075519975933 farolluz/parsers/cve.py
--- a/farolluz/parsers/cve.py	Tue Dec 30 12:17:45 2014 +0100
+++ b/farolluz/parsers/cve.py	Tue Dec 30 12:18:09 2014 +0100
@@ -99,7 +99,10 @@
 
 def parse_CVE_from_GSA(data):
     xml = parseXML(data)
-    return parse(xml.find('/'.join(['get_info', 'get_info_response', 'info', 'cve', 'raw_data', UN('cve', 'entry')])))
+    content = xml.find('/'.join(['get_info', 'get_info_response', 'info', 'cve', 'raw_data', UN('cve', 'entry')]))
+    if content is None:
+        return None
+    return parse(content)
 
 def parse(xml):
     xml = parseXML(xml)


More information about the Farol-commits mailing list