summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_lzma.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-09-27 17:23:41 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-09-27 17:23:41 (GMT)
commita12e7842a5f572afd6bde108f24931f9262f38ef (patch)
treea7bd0d9db6ec6a3c16cff1e2ac3a343a230dadd6 /Lib/test/test_lzma.py
parent19f2327e7ee3cc307b8b59329c552583d29ffa57 (diff)
parentc0b7037d4fc0f85af858cfa56df4dca25fb8896f (diff)
downloadcpython-a12e7842a5f572afd6bde108f24931f9262f38ef.zip
cpython-a12e7842a5f572afd6bde108f24931f9262f38ef.tar.gz
cpython-a12e7842a5f572afd6bde108f24931f9262f38ef.tar.bz2
Issue #28275: Fixed possible use adter free in LZMADecompressor.decompress().
Original patch by John Leitch.
Diffstat (limited to 'Lib/test/test_lzma.py')
-rw-r--r--Lib/test/test_lzma.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py
index d310bea..77ca022 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):