Issue #18559: Fix NULL pointer dereference error in _pickle module
This commit is contained in:
commit
f446d21708
|
@ -166,6 +166,8 @@ Core and Builtins
|
|||
Library
|
||||
-------
|
||||
|
||||
- Issue #18559: Fix NULL pointer dereference error in _pickle module
|
||||
|
||||
- Issue #18556: Check the return type of PyUnicode_AsWideChar() in ctype's
|
||||
U_set().
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue