mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #28275: Fixed possible use adter free in LZMADecompressor.decompress().
Original patch by John Leitch.
This commit is contained in:
commit
a12e7842a5
3 changed files with 15 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue