]> 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 04:25:16 +0000 (12:25 +0800)
committerGitHub <noreply@github.com>
Mon, 20 Feb 2017 04:25:16 +0000 (12:25 +0800)
Misc/NEWS
Objects/weakrefobject.c

index 752ce052fbb16e0fe8570b333c3f0debfd78e8e3..0c2a5730e31388fbcf725811f28816724da097f7 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.7.0 alpha 1?
 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.
 
 - bpo-29546: Set the 'path' and 'name' attribute on ImportError for ``from ... import ...``.
index d12db9185d8611082aa53eed308f4a06be8feb34..da05950f3f42071d1d8ef0cf1287b05b76a1d13d 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;
 }