Skip to content

Commit d0e8212

Browse files
authored
bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref objects (#128)
1 parent e395c4d commit d0e8212

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ What's New in Python 3.7.0 alpha 1?
1010
Core and Builtins
1111
-----------------
1212

13+
- bpo-29347: Fixed possibly dereferencing undefined pointers
14+
when creating weakref objects.
15+
1316
- bpo-29438: Fixed use-after-free problem in key sharing dict.
1417

1518
- bpo-29546: Set the 'path' and 'name' attribute on ImportError for ``from ... import ...``.

Objects/weakrefobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ init_weakref(PyWeakReference *self, PyObject *ob, PyObject *callback)
2424
{
2525
self->hash = -1;
2626
self->wr_object = ob;
27+
self->wr_prev = NULL;
28+
self->wr_next = NULL;
2729
Py_XINCREF(callback);
2830
self->wr_callback = callback;
2931
}

0 commit comments

Comments
 (0)