summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorSalvatore Bonaccorso <carnil@debian.org>2023-04-28 23:02:42 +0200
committerSalvatore Bonaccorso <carnil@debian.org>2023-04-28 23:02:42 +0200
commit564f7cfbf638c3779692e1a8e630f116eb7ef775 (patch)
treed057c66fc88fd6861f1fd5caefa79f2e8e8ec92e /bin
parent465a8b58f3683275ad03007e2da4f028e6c9b898 (diff)
process-cve-records: Workaround descriptions with non-ascii characters
This restores previous storing of the truncated descriptions in our CVE list files until we know we can handle all non-ascii characters. Particular care might be needed on webservice side. Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/process-cve-records4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/process-cve-records b/bin/process-cve-records
index 7892819706..9f30c7fcf9 100755
--- a/bin/process-cve-records
+++ b/bin/process-cve-records
@@ -73,7 +73,9 @@ def parse_record(record, cve):
desc = desc.replace('\n', ' ')
# and even non-printable characters such as \xa0 (&nbsp;)
- desc = "".join([ c for c in desc if c.isprintable() ])
+ # if a character is non-ascii then return character in
+ # ASCII-only representation.
+ desc = "".join([ c if ord(c) < 128 else ascii(c).strip('\'') for c in desc if c.isprintable() ])
# and some contain leading spaces
desc = desc.strip()

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