mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Issue #28275: Clean up to avoid use-after-free after bzip decompress failure
This commit is contained in:
parent
34b9d14be6
commit
38317d3318
4 changed files with 14 additions and 7 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue