]> granicus.if.org Git - python/commit
bpo-37764: Fix infinite loop when parsing unstructured email headers. (GH-15239)
authorAshwin Ramaswami <aramaswamis@gmail.com>
Sat, 31 Aug 2019 15:25:35 +0000 (10:25 -0500)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 31 Aug 2019 15:25:35 +0000 (08:25 -0700)
commitc5b242f87f31286ad38991bc3868cf4cfbf2b681
tree80f7659bec45074eb85998dfc041c0e1176b5dcc
parentdaa82d019c52e95c3c57275307918078c1c0ac81
bpo-37764: Fix infinite loop when parsing unstructured email headers. (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
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]