Visitar URL original
bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref objects by zhangyangyu · Pull Request #128 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Fix possibly dereferencing undefined pointers when creating weakref o…
…bjects
  • Loading branch information
zhangyangyu committed Feb 16, 2017
commit c885256356f7e9a8aad927b88776892c8a0f3759
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