diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-27 17:14:26 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-27 17:14:26 (GMT) |
commit | c0b7037d4fc0f85af858cfa56df4dca25fb8896f (patch) | |
tree | 4e003642f99456c981bc0735d91dc52d3f70e90f /Lib/test | |
parent | f18a5daadd6dc9d43a673a6f363d0116bee20210 (diff) | |
download | cpython-c0b7037d4fc0f85af858cfa56df4dca25fb8896f.zip cpython-c0b7037d4fc0f85af858cfa56df4dca25fb8896f.tar.gz cpython-c0b7037d4fc0f85af858cfa56df4dca25fb8896f.tar.bz2 |
Issue #28275: Fixed possible use adter free in LZMADecompressor.decompress().
Original patch by John Leitch.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_lzma.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py index 6c698e2..afd2767 100644 --- a/Lib/test/test_lzma.py +++ b/Lib/test/test_lzma.py @@ -246,6 +246,15 @@ class CompressorDecompressorTestCase(unittest.TestCase): lzd = LZMADecompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_1) self.assertRaises(LZMAError, lzd.decompress, COMPRESSED_XZ) + def test_decompressor_bug_28275(self): + # Test coverage for Issue 28275 + lzd = LZMADecompressor() + for i in range(2): + try: + lzd.decompress(COMPRESSED_RAW_1) + except LZMAError: + pass + # Test that LZMACompressor->LZMADecompressor preserves the input data. def test_roundtrip_xz(self): |