diff options
author | Abhilash Raj <maxking@users.noreply.github.com> | 2019-06-04 18:00:47 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2019-06-04 18:00:47 (GMT) |
commit | aa79707262f893428665ef45b5e879129abca4aa (patch) | |
tree | aae19b8d8d91417c315cfe599236329eaa6b3bdc /Lib/turtle.py | |
parent | 46d88a113142b26c01c95c93846a89318ba87ffc (diff) | |
download | cpython-aa79707262f893428665ef45b5e879129abca4aa.zip cpython-aa79707262f893428665ef45b5e879129abca4aa.tar.gz cpython-aa79707262f893428665ef45b5e879129abca4aa.tar.bz2 |
bpo-30835: email: Fix AttributeError when parsing invalid CTE (GH-13598)
* bpo-30835: email: Fix AttributeError when parsing invalid Content-Transfer-Encoding
Parsing an email containing a multipart Content-Type, along with a
Content-Transfer-Encoding containing an invalid (non-ASCII-decodable) byte
will fail. email.feedparser.FeedParser._parsegen() gets the header and
attempts to convert it to lowercase before comparing it with the accepted
encodings, but as the header contains an invalid byte, it's returned as a
Header object rather than a str.
Cast the Content-Transfer-Encoding header to a str to avoid this.
Found using the AFL fuzzer.
Reported-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Andrew Donnellan <andrew@donnellan.id.au>
* Add email and NEWS entry for the bugfix.
Diffstat (limited to 'Lib/turtle.py')
0 files changed, 0 insertions, 0 deletions