diff options
author | Salvatore Bonaccorso <carnil@debian.org> | 2023-04-28 23:02:42 +0200 |
---|---|---|
committer | Salvatore Bonaccorso <carnil@debian.org> | 2023-04-28 23:02:42 +0200 |
commit | 564f7cfbf638c3779692e1a8e630f116eb7ef775 (patch) | |
tree | d057c66fc88fd6861f1fd5caefa79f2e8e8ec92e /bin | |
parent | 465a8b58f3683275ad03007e2da4f028e6c9b898 (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-x | bin/process-cve-records | 4 |
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 ( ) - 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() |