diff options
author | Salvatore Bonaccorso <carnil@debian.org> | 2019-03-22 08:34:31 +0100 |
---|---|---|
committer | Salvatore Bonaccorso <carnil@debian.org> | 2019-03-22 08:36:09 +0100 |
commit | 6b9bd75bc8e76a38ff28487ea608ba151da1d93f (patch) | |
tree | 09371919bf35633f488660b45c7fccc75a16f13d /bin/report-vuln | |
parent | f71cff04d73fa490c4c5dfa85bacae83ca107c21 (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/report-vuln')
-rwxr-xr-x | bin/report-vuln | 5 |
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: |