]> granicus.if.org Git - python/commitdiff
bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref object...
authorXiang Zhang <angwerzx@126.com>
Mon, 20 Feb 2017 06:33:06 +0000 (14:33 +0800)
committerGitHub <noreply@github.com>
Mon, 20 Feb 2017 06:33:06 +0000 (14:33 +0800)
Misc/NEWS
Objects/weakrefobject.c

index c750d5c952e6e958c4723785a0f47028c9636de6..52c87d88c72664f3bd7f1bab9f093ccadc790597 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ Release date: XXXX-XX-XX
 Core and Builtins
 -----------------
 
+- bpo-29347: Fixed possibly dereferencing undefined pointers
+  when creating weakref objects.
+
 - bpo-29438: Fixed use-after-free problem in key sharing dict.
 
 - Issue #29319: Prevent RunMainFromImporter overwriting sys.path[0].
index 7e6f36458bc693cffeee1e329196e0af0da9e52d..892798affe9fe2b1dbd9d3a99de3b150b997c6ea 100644 (file)
@@ -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;
 }