Staging
v0.5.1
Revision f62a372928fbf6a2ba722f12f069b75ca6ad16fb authored by Miss Islington (bot) on 05 June 2019, 10:23:37 UTC, committed by GitHub on 05 June 2019, 10:23:37 UTC

* 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.
(cherry picked from commit aa79707262f893428665ef45b5e879129abca4aa)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
1 parent 3d75bd1
History
File Mode Size
.azure-pipelines
.github
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Programs
Python
Tools
m4
.gitattributes -rw-r--r-- 1.6 KB
.gitignore -rw-r--r-- 1.5 KB
.travis.yml -rw-r--r-- 6.1 KB
CODE_OF_CONDUCT.rst -rw-r--r-- 631 bytes
LICENSE -rw-r--r-- 12.5 KB
Makefile.pre.in -rw-r--r-- 62.2 KB
README.rst -rw-r--r-- 9.9 KB
aclocal.m4 -rw-r--r-- 10.7 KB
config.guess -rwxr-xr-x 43.1 KB
config.sub -rwxr-xr-x 35.4 KB
configure -rwxr-xr-x 491.6 KB
configure.ac -rw-r--r-- 163.7 KB
install-sh -rwxr-xr-x 7.0 KB
pyconfig.h.in -rw-r--r-- 42.2 KB
setup.py -rw-r--r-- 99.7 KB

README.rst

back to top