Visitar URL original
bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref objects by zhangyangyu · Pull Request #188 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-29347: Fix possibly dereferencing undefined pointers when creatin…
…g weakref objects (#128)
  • Loading branch information
zhangyangyu committed Feb 20, 2017
commit 7e67474ed62fb90ffbfa529440e06e0ac418697c
3 changes: 3 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down
2 changes: 2 additions & 0 deletions Objects/weakrefobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down