aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Buchholz <rbu@gentoo.org>2008-10-19 20:02:40 +0000
committerRobert Buchholz <rbu@gentoo.org>2008-10-19 20:02:40 +0000
commit4bdcc737fff423b75029329fae2d457fa8fbb5c4 (patch)
tree9162eaee1fd818c60e9271ba82b193cf605bde54 /lib
parentReverting two NFU/BUGs since we might be affected (diff)
downloadsecurity-4bdcc737fff423b75029329fae2d457fa8fbb5c4.tar.gz
security-4bdcc737fff423b75029329fae2d457fa8fbb5c4.tar.bz2
security-4bdcc737fff423b75029329fae2d457fa8fbb5c4.zip
Improve tools: Better whiteboard heuristics for target, guess_name for cve
svn path=/; revision=819
Diffstat (limited to 'lib')
-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