Kaydet (Commit) 0f8b31a2 authored tarafından Neal Norwitz's avatar Neal Norwitz

Fix bug #1512695: cPickle.loads could crash if it was interrupted with

a KeyboardInterrupt since PyTuple_Pack was passed a NULL.

Will backport.
üst 7983c729
...@@ -28,6 +28,12 @@ Library ...@@ -28,6 +28,12 @@ Library
- The wsgiref package is now installed properly on Unix. - The wsgiref package is now installed properly on Unix.
Extension Modules
-----------------
- Bug #1512695: cPickle.loads could crash if it was interrupted with
a KeyboardInterrupt.
Build Build
----- -----
......
...@@ -3628,10 +3628,14 @@ Instance_New(PyObject *cls, PyObject *args) ...@@ -3628,10 +3628,14 @@ Instance_New(PyObject *cls, PyObject *args)
err: err:
{ {
PyObject *tp, *v, *tb; PyObject *tp, *v, *tb, *tmp_value;
PyErr_Fetch(&tp, &v, &tb); PyErr_Fetch(&tp, &v, &tb);
if ((r=PyTuple_Pack(3,v,cls,args))) { tmp_value = v;
/* NULL occurs when there was a KeyboardInterrupt */
if (tmp_value == NULL)
tmp_value = Py_None;
if ((r = PyTuple_Pack(3, tmp_value, cls, args))) {
Py_XDECREF(v); Py_XDECREF(v);
v=r; v=r;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment