]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.7] bpo-37764: Fix infinite loop when parsing unstructured email headers. (GH-15239...
authorAshwin Ramaswami <aramaswamis@gmail.com>
Tue, 3 Sep 2019 16:42:53 +0000 (09:42 -0700)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 3 Sep 2019 16:42:53 +0000 (09:42 -0700)
commitea21389dda401457198fb214aa2c981a45ed9528
treefa4232b8646ea424f1411e18fe22f64061bef9c5
parent48058050cee5f6600150392100c162f223b4317f
[3.7] bpo-37764: Fix infinite loop when parsing unstructured email headers. (GH-15239) (GH-15654)

…aders. (GH-15239)

Fixes a case in which email._header_value_parser.get_unstructured hangs the system for some invalid headers. This covers the cases in which the header contains either:
- a case without trailing whitespace
- an invalid encoded word

https://bugs.python.org/issue37764

This fix should also be backported to 3.7 and 3.8

https://bugs.python.org/issue37764
(cherry picked from commit c5b242f87f31286ad38991bc3868cf4cfbf2b681)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
https://bugs.python.org/issue37764
Lib/email/_header_value_parser.py
Lib/test/test_email/test__header_value_parser.py
Lib/test/test_email/test_email.py
Misc/ACKS
Misc/NEWS.d/next/Security/2019-08-27-01-13-05.bpo-37764.qv67PQ.rst [new file with mode: 0644]