aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-06-27 16:18:46 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-06-27 16:18:46 -0400
commit05523677e7574eec399c8842f7191e1df1638d50 (patch)
tree0bf8fa275c01e5ba3644f5edfc1af817ccc9c17e
parentc063a4065dc17aa05ef1a97abd1aee066df977f6 (diff)
downloadb4-05523677e7574eec399c8842f7191e1df1638d50.tar.gz
Ignore non-ascii follow-up trailers
The trailer *names* should always be ascii. While it is possible to imagine that some project would have non-ascii trailer names like: Signalé-par: Developpeur Un <d1@example.com> Co-développé-avec: Developpeur Deux <d2@example.com> Nonetheless, I am not aware of any project doing this, and this allows us to weed out a bunch of false-positives from bad forwards. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index b03ed83..c07ee91 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -1397,6 +1397,9 @@ class LoreMessage:
logger.debug('Ignoring %s (header after other content)', line)
continue
if followup:
+ if not tname.isascii():
+ logger.debug('Ignoring known non-ascii follow-up trailer: %s', tname)
+ continue
mperson = re.search(r'\S+@\S+\.\S+', groups[1])
if not mperson and tname not in nonperson:
logger.debug('Ignoring %s (not a recognized non-person trailer)', line)