diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-10-01 02:45:17 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-10-01 02:45:17 (GMT) |
commit | 38317d3318e05832a864d413aa744a48a8975dce (patch) | |
tree | 8757c1d2116ed1d20aa28b02e0b11f05e9bc3412 /Lib/test/test_lzma.py | |
parent | 34b9d14be642be80e9ac10c59004570a7efa5804 (diff) | |
download | cpython-38317d3318e05832a864d413aa744a48a8975dce.zip cpython-38317d3318e05832a864d413aa744a48a8975dce.tar.gz cpython-38317d3318e05832a864d413aa744a48a8975dce.tar.bz2 |
Issue #28275: Clean up to avoid use-after-free after bzip decompress failure
Diffstat (limited to 'Lib/test/test_lzma.py')
-rw-r--r-- | Lib/test/test_lzma.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py index afd2767..16e89d5 100644 --- a/Lib/test/test_lzma.py +++ b/Lib/test/test_lzma.py @@ -249,11 +249,9 @@ class CompressorDecompressorTestCase(unittest.TestCase): 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 + self.assertRaises(LZMAError, lzd.decompress, COMPRESSED_RAW_1) + # Previously, a second call could crash due to internal inconsistency + self.assertRaises(LZMAError, lzd.decompress, COMPRESSED_RAW_1) # Test that LZMACompressor->LZMADecompressor preserves the input data. |