aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/cvetools.py')
-rw-r--r--lib/python/cvetools.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/python/cvetools.py b/lib/python/cvetools.py
index 0a6506a..69899cf 100644
--- a/lib/python/cvetools.py
+++ b/lib/python/cvetools.py
@@ -57,7 +57,10 @@ class CVEData:
return self.cvedata[cve]['refs']
def guess_name_for(self, cve):
- refs = self.cvedata[cve]['refs']
+ try:
+ refs = self.cvedata[cve]['refs']
+ except KeyError:
+ return {}
SAs = []
names = {}
for url in refs:
@@ -70,7 +73,7 @@ class CVEData:
match = re.findall(r'<b>Provided and/or discovered by</b>:(.+?)<b>', html, flags = re.S)
if match:
text = re.sub('<.*?>', '', match[0])
- names[SAid] = [re.sub(r'^[\d,) ]*(.* credits)?', '', line).strip() for line in text.split('\n')]
+ names[SAid] = [re.sub(r'in a .* bug report', '', re.sub(r'^[\d,) ]*(.* credits|Reported by)?', '', line)).strip(' \n.') for line in text.split('\n')]
return names