diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2008-04-09 00:25:17 +0000 |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2008-04-09 00:25:17 +0000 |
commit | 79e42a0e0817b9c9fc23b333524427662b33986d (patch) | |
tree | 5e61bf69ea3291250f08e8616665d941345057d4 /Lib/test/test_zlib.py | |
parent | e41b0061dd908251a393f77b030c9e7308ecd5c5 (diff) | |
download | cpython-git-79e42a0e0817b9c9fc23b333524427662b33986d.tar.gz |
Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
It tried to allocate negative or zero memory. That fails.
Diffstat (limited to 'Lib/test/test_zlib.py')
-rw-r--r-- | Lib/test/test_zlib.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py index 0c96842c77..adb87ff0fa 100644 --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -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): |