summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorXiang Zhang <angwerzx@126.com>2017-02-20 06:33:06 (GMT)
committerGitHub <noreply@github.com>2017-02-20 06:33:06 (GMT)
commit7c95a94c3ab41e4296e94335d66b2400ad16f052 (patch)
tree007d90de8ee59e2dd457ca44c7b45aa6e0247bd0 /Objects
parent314a86bae2ecc5e22bc874ad8a1bb71eb732dda6 (diff)
downloadcpython-7c95a94c3ab41e4296e94335d66b2400ad16f052.zip
cpython-7c95a94c3ab41e4296e94335d66b2400ad16f052.tar.gz
cpython-7c95a94c3ab41e4296e94335d66b2400ad16f052.tar.bz2
bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref objects (#128) (#188)
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 7e6f364..892798a 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;
}