Commit 7131a73f authored by Xiang Zhang's avatar Xiang Zhang Committed by GitHub

bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref...

bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref objects (#128) (#187)
parent af9a40d5
...@@ -10,6 +10,9 @@ What's New in Python 2.7.14? ...@@ -10,6 +10,9 @@ What's New in Python 2.7.14?
Core and Builtins Core and Builtins
----------------- -----------------
- bpo-29347: Fixed possibly dereferencing undefined pointers
when creating weakref objects.
- Issue #14376: Allow sys.exit to accept longs as well as ints. Patch - Issue #14376: Allow sys.exit to accept longs as well as ints. Patch
by Gareth Rees. by Gareth Rees.
......
...@@ -24,6 +24,8 @@ init_weakref(PyWeakReference *self, PyObject *ob, PyObject *callback) ...@@ -24,6 +24,8 @@ init_weakref(PyWeakReference *self, PyObject *ob, PyObject *callback)
{ {
self->hash = -1; self->hash = -1;
self->wr_object = ob; self->wr_object = ob;
self->wr_prev = NULL;
self->wr_next = NULL;
Py_XINCREF(callback); Py_XINCREF(callback);
self->wr_callback = callback; self->wr_callback = callback;
} }
......
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