diff options
author | Tal Einat <taleinat+github@gmail.com> | 2018-06-12 12:46:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-12 12:46:22 (GMT) |
commit | c3f55be7dd012b7e92901627d0b31c21e983ccb4 (patch) | |
tree | 86fb2e7e33615aee453d73f27063a4ec345e89fa /Doc/library/email.errors.rst | |
parent | 5a9820918077a65db90f24733edc8935c3e2130e (diff) | |
download | cpython-c3f55be7dd012b7e92901627d0b31c21e983ccb4.zip cpython-c3f55be7dd012b7e92901627d0b31c21e983ccb4.tar.gz cpython-c3f55be7dd012b7e92901627d0b31c21e983ccb4.tar.bz2 |
bpo-27397: Make email module properly handle invalid-length base64 strings (#7583)
When attempting to base64-decode a payload of invalid length (1 mod 4),
properly recognize and handle it. The given data will be returned as-is,
i.e. not decoded, along with a new defect, InvalidBase64LengthDefect.
Diffstat (limited to 'Doc/library/email.errors.rst')
-rw-r--r-- | Doc/library/email.errors.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/library/email.errors.rst b/Doc/library/email.errors.rst index 5838767..511ad16 100644 --- a/Doc/library/email.errors.rst +++ b/Doc/library/email.errors.rst @@ -108,3 +108,7 @@ All defect classes are subclassed from :class:`email.errors.MessageDefect`. * :class:`InvalidBase64CharactersDefect` -- When decoding a block of base64 encoded bytes, characters outside the base64 alphabet were encountered. The characters are ignored, but the resulting decoded bytes may be invalid. + +* :class:`InvalidBase64LengthDefect` -- When decoding a block of base64 encoded + bytes, the number of non-padding base64 characters was invalid (1 more than + a multiple of 4). The encoded block was kept as-is. |