python/dist/src/Lib/test test_zlib.py,1.26,1.27
Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27207/Lib/test Modified Files: test_zlib.py Log Message: [Bug #1083110] calling .flush() on decompress objects causes a segfault due to an uninitialized pointer: fixes the problem and adds a test case Index: test_zlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_zlib.py,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- test_zlib.py 5 Jun 2004 19:34:28 -0000 1.26 +++ test_zlib.py 28 Dec 2004 20:10:37 -0000 1.27 @@ -290,6 +290,16 @@ # if decompressed data is different from the input data, choke. self.assertEqual(expanded, data, "17K random source doesn't match") + def test_empty_flush(self): + # Test that calling .flush() on unused objects works. + # (Bug #1083110 -- calling .flush() on decompress objects + # caused a core dump.) + + co = zlib.compressobj(zlib.Z_BEST_COMPRESSION) + self.failUnless(co.flush()) # Returns a zlib header + dco = zlib.decompressobj() + self.assertEqual(dco.flush(), "") # Returns nothing + def genblock(seed, length, step=1024, generator=random): """length-byte stream of random data from a seed (in step-byte blocks)."""
participants (1)
-
akuchling@users.sourceforge.net