diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-01-17 13:31:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-17 13:31:33 (GMT) |
commit | 00e77935193221f1601405587b9ec05c14c13284 (patch) | |
tree | 28d9a13660a50ff54eb673fec3edeaa162fcf57f /Lib/test | |
parent | 27941b14ab9ecdb88fe2ced68b50fa428c2ea8f2 (diff) | |
download | cpython-00e77935193221f1601405587b9ec05c14c13284.zip cpython-00e77935193221f1601405587b9ec05c14c13284.tar.gz cpython-00e77935193221f1601405587b9ec05c14c13284.tar.bz2 |
[3.12] gh-104282: Fix null pointer dereference in `lzma._decode_filter_properties` (GH-104283) (GH-114181)
(cherry picked from commit 0154405350c272833bd51f68138223655e142a37)
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_lzma.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py index 13b2009..65e6488 100644 --- a/Lib/test/test_lzma.py +++ b/Lib/test/test_lzma.py @@ -1401,6 +1401,14 @@ class MiscellaneousTestCase(unittest.TestCase): self.assertEqual(filterspec["lc"], 3) self.assertEqual(filterspec["dict_size"], 8 << 20) + # see gh-104282 + filters = [lzma.FILTER_X86, lzma.FILTER_POWERPC, + lzma.FILTER_IA64, lzma.FILTER_ARM, + lzma.FILTER_ARMTHUMB, lzma.FILTER_SPARC] + for f in filters: + filterspec = lzma._decode_filter_properties(f, b"") + self.assertEqual(filterspec, {"id": f}) + def test_filter_properties_roundtrip(self): spec1 = lzma._decode_filter_properties( lzma.FILTER_LZMA1, b"]\x00\x00\x80\x00") |