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

Daniel Axtens dja at axtens.net
Mon Mar 27 16:01:13 AEDT 2017


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>
---
 patchwork/parser.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/patchwork/parser.py b/patchwork/parser.py
index 7e2067efd93f..7ec024c5d65b 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,
-- 
2.9.3



More information about the Patchwork mailing list