summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Axtens <dja@axtens.net>2017-03-27 16:01:13 +1100
committerStephen Finucane <stephen@that.guru>2017-04-09 17:18:35 +0100
commite80079e3fc91b1dcab142ff8e598ba563e151fb0 (patch)
treeb37807d3b0b752fe17aa33ebd086f18165a400c9
parent21e2926743a15dc0ef896a8ef9ccf6e7d59c42cf (diff)
downloadpatchwork-e80079e3fc91b1dcab142ff8e598ba563e151fb0.tar
patchwork-e80079e3fc91b1dcab142ff8e598ba563e151fb0.tar.gz
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 <ruscur@russell.cc> Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Stephen Finucane <stephen@that.guru>
-rw-r--r--patchwork/parser.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/patchwork/parser.py b/patchwork/parser.py
index 7e2067e..b81f5b1 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,