mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
It tried to allocate negative or zero memory. That fails.
This commit is contained in:
parent
e41b0061dd
commit
79e42a0e08
2 changed files with 9 additions and 0 deletions
|
|
@ -83,6 +83,11 @@ class ExceptionTestCase(unittest.TestCase):
|
|||
# verify failure on building decompress object with bad params
|
||||
self.assertRaises(ValueError, zlib.decompressobj, 0)
|
||||
|
||||
def test_decompressobj_badflush(self):
|
||||
# verify failure on calling decompressobj.flush with bad params
|
||||
self.assertRaises(ValueError, zlib.decompressobj().flush, 0)
|
||||
self.assertRaises(ValueError, zlib.decompressobj().flush, -1)
|
||||
|
||||
|
||||
|
||||
class CompressTestCase(unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue