summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorXiang Zhang <angwerzx@126.com>2017-02-20 04:25:16 (GMT)
committerGitHub <noreply@github.com>2017-02-20 04:25:16 (GMT)
commitd0e8212ed70445cc3d48b0d4ae7c9cb480004010 (patch)
treea9d646b5f5aa9f193fb05b124c53d4f91ade1de1 /Objects
parente395c4dbe19115aaab315c2a113b172e9fef307a (diff)
downloadcpython-d0e8212ed70445cc3d48b0d4ae7c9cb480004010.zip
cpython-d0e8212ed70445cc3d48b0d4ae7c9cb480004010.tar.gz
cpython-d0e8212ed70445cc3d48b0d4ae7c9cb480004010.tar.bz2
bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref objects (#128)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/weakrefobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index d12db91..da05950 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -24,6 +24,8 @@ init_weakref(PyWeakReference *self, PyObject *ob, PyObject *callback)
{
self->hash = -1;
self->wr_object = ob;
+ self->wr_prev = NULL;
+ self->wr_next = NULL;
Py_XINCREF(callback);
self->wr_callback = callback;
}