]> granicus.if.org Git - python/commit
Patch by Stephen Turner, who writes:
authorGuido van Rossum <guido@python.org>
Tue, 13 Jul 1999 15:18:58 +0000 (15:18 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 13 Jul 1999 15:18:58 +0000 (15:18 +0000)
commit2f80d96c043d11e51b9df119c99c8ee59df1ba6d
treeee339bad86638504bd0d38cd7cb3e0f1d0d9b32c
parent0eb55ac91208b58359e442553b6158739956ad39
Patch by Stephen Turner, who writes:

"""
It fixes a memory corruption error resulting from BadPickleGet
exceptions in load_get, load_binget and load_long_binget.  This was
initially reported on c.l.py as a problem with Cookie.py; see the thread
titled "python core dump (SIGBUS) on Solaris" for more details.

If PyDict_GetItem(self->memo, py_key) call failed, then py_key was being
Py_DECREF'd out of existence before call was made to
PyErr_SetObject(BadPickleGet, py_key).

The bug can be duplicated as follows:

import cPickle
cPickle.loads('garyp')

This raises a BadPickleGet exception whose value is a freed object.  A
core dump will soon follow.
"""

Jim Fulton approves of the patch.
Modules/cPickle.c