]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
parser: cut off patch names after 255 characters
authorDaniel Axtens <dja@axtens.net>
Mon, 27 Mar 2017 05:01:13 +0000 (16:01 +1100)
committerStephen Finucane <stephen@that.guru>
Sun, 9 Apr 2017 16:18:35 +0000 (17:18 +0100)
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@russell.cc>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Stephen Finucane <stephen@that.guru>
patchwork/parser.py

index 7e2067efd93f9c0918251c6121329e678f53485a..b81f5b1a641a0d876cd19876c845879c7545f1fa 100644 (file)
@@ -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,