From e80079e3fc91b1dcab142ff8e598ba563e151fb0 Mon Sep 17 00:00:00 2001 From: Daniel Axtens Date: Mon, 27 Mar 2017 16:01:13 +1100 Subject: [PATCH] parser: cut off patch names after 255 characters Our model limits the length of patch names to 255 characters. Enforce this cutoff in the parser, otherwise we throw an exception and fail to store patches with stupidly long titles. Reported-by: Russell Currey Signed-off-by: Daniel Axtens Signed-off-by: Stephen Finucane --- patchwork/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patchwork/parser.py b/patchwork/parser.py index 7e2067ef..b81f5b1a 100644 --- a/patchwork/parser.py +++ b/patchwork/parser.py @@ -828,7 +828,7 @@ def parse_mail(mail, list_id=None): patch = Patch( msgid=msgid, project=project, - name=name, + name=name[:255], date=date, headers=headers, submitter=author, @@ -895,7 +895,7 @@ def parse_mail(mail, list_id=None): cover_letter = CoverLetter( msgid=msgid, project=project, - name=name, + name=name[:255], date=date, headers=headers, submitter=author, -- 2.47.3