mirror of
https://github.com/python/cpython.git
synced 2026-04-22 03:41:08 +00:00
bpo-34987: Fix a possible null pointer dereference in _pickle.c's save_reduce(). (GH-9886)
(cherry picked from commit 25d389789c)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
parent
983d1ab0e6
commit
e2f376f284
1 changed files with 4 additions and 1 deletions
|
|
@ -3838,7 +3838,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…
Add table
Add a link
Reference in a new issue