Skip to content

Commit

Permalink
bpo-29347: Fix possibly dereferencing undefined pointers when creatin…
Browse files Browse the repository at this point in the history
…g weakref objects (python#128)
  • Loading branch information
zhangyangyu authored Feb 20, 2017
1 parent e395c4d commit d0e8212
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...``.
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

0 comments on commit d0e8212

Please sign in to comment.