]> granicus.if.org Git - python/commit
bpo-27397: Make email module properly handle invalid-length base64 strings (GH-7583...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 12 Jun 2018 13:46:26 +0000 (06:46 -0700)
committerTal Einat <taleinat+github@gmail.com>
Tue, 12 Jun 2018 13:46:26 +0000 (16:46 +0300)
commit63dd1f70c1aa57494802c9b68f9db4918620fc8f
tree2c64b4539d836a5bee6f58a5e88bedda81d3cc67
parent9e01ef2303c64aba456552156b570af72cac0d91
bpo-27397: Make email module properly handle invalid-length base64 strings (GH-7583) (GH-7665)

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

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
Doc/library/email.errors.rst
Lib/email/_encoded_words.py
Lib/email/errors.py
Lib/test/test_email/test__encoded_words.py
Lib/test/test_email/test__header_value_parser.py
Lib/test/test_email/test_defect_handling.py
Misc/NEWS.d/next/Library/2018-06-10-09-43-54.bpo-27397.0_fFQR.rst [new file with mode: 0644]