]> granicus.if.org Git - python/commit
Fix infinite loop in email folding logic (GH-12732)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 16 Jul 2019 18:08:36 +0000 (11:08 -0700)
committerGitHub <noreply@github.com>
Tue, 16 Jul 2019 18:08:36 +0000 (11:08 -0700)
commit6a2aec0ff587032beb8aac8cbebb09e7a52f6694
treef1aeaa1333a3a6f3de7deb5fd2810be7de17c1c6
parent86742d4ce8d6c301104e238699b30f6bdaf9f9cb
Fix infinite loop in email folding logic (GH-12732)

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 <pganssle@users.noreply.github.com>
Lib/email/_header_value_parser.py
Lib/email/parser.py
Lib/test/test_email/test_policy.py
Misc/NEWS.d/next/Library/2019-04-08-13-00-13.bpo-36564._n67m_.rst [new file with mode: 0644]