[PATCH 2/3] parser: limit emails and names to 255 chars

Andrew Donnellan andrew.donnellan at au1.ibm.com
Mon Jul 3 14:54:01 AEST 2017


Reviewed-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

On 01/07/17 14:28, Daniel Axtens wrote:
> Also picked up with afl-fuzz.
>
> Signed-off-by: Daniel Axtens <dja at axtens.net>
> ---
>  patchwork/parser.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/patchwork/parser.py b/patchwork/parser.py
> index 37603f944150..eab0a7d39863 100644
> --- a/patchwork/parser.py
> +++ b/patchwork/parser.py
> @@ -326,9 +326,9 @@ def find_author(mail):
>      if not email:
>          raise ValueError("Invalid 'From' header")
>
> -    email = email.strip()
> +    email = email.strip()[:255]
>      if name is not None:
> -        name = name.strip()
> +        name = name.strip()[:255]
>
>      try:
>          person = Person.objects.get(email__iexact=email)
>

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com  IBM Australia Limited



More information about the Patchwork mailing list