mirror of
https://github.com/python/cpython.git
synced 2024-12-03 06:46:01 +08:00
aa79707262
* 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.
4 lines
172 B
ReStructuredText
4 lines
172 B
ReStructuredText
Fixed a bug in email parsing where a message with invalid bytes in
|
|
content-transfer-encoding of a multipart message can cause an AttributeError.
|
|
Patch by Andrew Donnellan.
|