From: Daniel Axtens Date: Mon, 27 Mar 2017 05:01:13 +0000 (+1100) Subject: parser: cut off patch names after 255 characters X-Git-Tag: v2.0.0-rc1~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e80079e3fc91b1dcab142ff8e598ba563e151fb0;p=thirdparty%2Fpatchwork.git 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 --- 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,