[PATCH] parser: cut off patch names after 255 characters

Stephen Finucane stephen at that.guru
Mon Apr 10 02:21:14 AEST 2017


On Mon, 2017-03-27 at 16:01 +1100, Daniel Axtens wrote:
> 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 <ruscur at russell.cc>
> Signed-off-by: Daniel Axtens <dja at axtens.net>

Applied after adding the following fix to also handle long series
names.

diff --git a/patchwork/parser.py b/patchwork/parser.py
index 7ec024c..b81f5b1 100644
--- a/patchwork/parser.py
+++ b/patchwork/parser.py
@@ -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,

---
Stephen


More information about the Patchwork mailing list