summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-04-09 00:26:44 +0000
committerGregory P. Smith <greg@mad-scientist.com>2008-04-09 00:26:44 +0000
commitf62346775911d56b5440ec7fd699b749f5106436 (patch)
tree376a3e64f1fc6496f3b5f812a56e92e85f51a513 /Lib
parent45c2f778c4b4f4c5756d37014e0f39483e37d297 (diff)
downloadcpython-git-f62346775911d56b5440ec7fd699b749f5106436.tar.gz
Merge r62235 from trunk.
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')
-rw-r--r--Lib/test/test_zlib.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
index 4440942ac9..6b3b12eccc 100644
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -71,6 +71,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):