summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorSalvatore Bonaccorso <carnil@debian.org>2019-03-22 08:34:31 +0100
committerSalvatore Bonaccorso <carnil@debian.org>2019-03-22 08:36:09 +0100
commitdd8870d35e6bea61c46d779579363b369c873f4f (patch)
treefc9c85621f7e67daf1ea38afd7aab2c4e35d5ec6 /bin
parente712117684ac5c744e8996ec1c67c4d8f404a390 (diff)
Wrap long CVE descrptions for the vulnerability report template
MITRE changed the layout of the html pages for the CVE entries resulting in long lines for the CVE descpritons not wrapped anymore directly already in the fetched HTML. Switch to use texwrap module to wrap the text in the description lines and to be prefixed with a marker if the description is too long to be hold in one line. Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/report-vuln5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/report-vuln b/bin/report-vuln
index eb1d713558..7e8f93b506 100755
--- a/bin/report-vuln
+++ b/bin/report-vuln
@@ -14,6 +14,7 @@ from __future__ import print_function
import argparse
from tempfile import NamedTemporaryFile
import sys, re, urllib, os
+from textwrap import wrap
temp_id = re.compile('(?:CVE|cve)\-[0-9]{4}-XXXX')
@@ -89,7 +90,9 @@ def get_cve(id):
continue
if desc and '<td colspan="2">' in line:
- ret += '| ' + re.sub('.*<td colspan="2">', '', line)
+ line = re.sub('.*<td colspan="2">', '', line)
+ for line in wrap(line):
+ ret += '| ' + line + '\n'
continue
if desc and '</td>' in line:

© 2014-2024 Faster IT GmbH | imprint | privacy policy