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

index b631fde8e52e0dcf2b86fde5c438ac70de01d901..0fed99b5e7808f15e52bd14b598a755f6464ae91 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.6.1 release candidate 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.
 
 - Issue #29319: Prevent RunMainFromImporter overwriting sys.path[0].
index ab6b23525552b83b2f8a51c633d0694eb155dda3..9ca386da2563cb73d658685667850be8b4df528a 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;
 }