diff mbox

parser: cut off patch names after 255 characters

Message ID 20170327050113.22312-1-dja@axtens.net
State Accepted
Headers show

Commit Message

Daniel Axtens March 27, 2017, 5:01 a.m. UTC
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>
---
 patchwork/parser.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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,