From 79a47e2b9cff6c9facdbc022a752177ab89dc533 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sun, 21 Jul 2019 07:01:43 -0700 Subject: Fix infinite loop in email folding logic (GH-12732) (GH-14799) As far as I can tell, this infinite loop would be triggered if: 1. The value being folded contains a single word (no spaces) longer than max_line_length 2. The max_line_length is shorter than the encoding's name + 9 characters. bpo-36564: https://bugs.python.org/issue36564 (cherry picked from commit f69d5c61981ea97d251db515c7ff280fcc17182d) Co-authored-by: Paul Ganssle --- Lib/email/parser.py | 1 - 1 file changed, 1 deletion(-) (limited to 'Lib/email/parser.py') diff --git a/Lib/email/parser.py b/Lib/email/parser.py index 555b172560..7db4da1ff0 100644 --- a/Lib/email/parser.py +++ b/Lib/email/parser.py @@ -13,7 +13,6 @@ from email.feedparser import FeedParser, BytesFeedParser from email._policybase import compat32 - class Parser: def __init__(self, _class=None, *, policy=compat32): """Parser of RFC 2822 and MIME email messages. -- cgit v1.2.1