diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-26 20:45:47 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-26 20:45:47 (GMT) |
commit | f446d217089e61778c794023f38932e2c2798234 (patch) | |
tree | d405b8364200be84d492b4b3a2b63bf30161f782 /Modules | |
parent | d4095d95f87010751ebc0b656a87f422ce5480ad (diff) | |
parent | 9ee5c37c8f8c4f35814453aecf5fdfd01dfa2781 (diff) | |
download | cpython-f446d217089e61778c794023f38932e2c2798234.zip cpython-f446d217089e61778c794023f38932e2c2798234.tar.gz cpython-f446d217089e61778c794023f38932e2c2798234.tar.bz2 |
Issue #18559: Fix NULL pointer dereference error in _pickle module
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_pickle.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 4ba185d..af73a84 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -4836,9 +4836,10 @@ load_binget(UnpicklerObject *self) value = _Unpickler_MemoGet(self, idx); if (value == NULL) { PyObject *key = PyLong_FromSsize_t(idx); - if (!PyErr_Occurred()) + if (key != NULL) { PyErr_SetObject(PyExc_KeyError, key); - Py_DECREF(key); + Py_DECREF(key); + } return -1; } @@ -4861,9 +4862,10 @@ load_long_binget(UnpicklerObject *self) value = _Unpickler_MemoGet(self, idx); if (value == NULL) { PyObject *key = PyLong_FromSsize_t(idx); - if (!PyErr_Occurred()) + if (key != NULL) { PyErr_SetObject(PyExc_KeyError, key); - Py_DECREF(key); + Py_DECREF(key); + } return -1; } |