mirror of https://github.com/python/cpython
bpo-34987: Fix a possible null pointer dereference in _pickle.c's save_reduce(). (GH-9886)
This commit is contained in:
parent
5b25f1d031
commit
25d389789c
|
@ -3840,7 +3840,10 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
|
|||
|
||||
if (obj != NULL) {
|
||||
obj_class = get_class(obj);
|
||||
p = obj_class != cls; /* true iff a problem */
|
||||
if (obj_class == NULL) {
|
||||
return -1;
|
||||
}
|
||||
p = obj_class != cls;
|
||||
Py_DECREF(obj_class);
|
||||
if (p) {
|
||||
PyErr_SetString(st->PicklingError, "args[0] from "
|
||||
|
|
Loading…
Reference in New Issue