]> granicus.if.org Git - python/commitdiff
bpo-33803: Fix a crash in hamt.c (#7504)
authorYury Selivanov <yury@magic.io>
Fri, 8 Jun 2018 00:29:55 +0000 (20:29 -0400)
committerGitHub <noreply@github.com>
Fri, 8 Jun 2018 00:29:55 +0000 (20:29 -0400)
Misc/NEWS.d/next/Core and Builtins/2018-06-07-20-18-38.bpo-33803.n-Nq6_.rst [new file with mode: 0644]
Python/hamt.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-06-07-20-18-38.bpo-33803.n-Nq6_.rst b/Misc/NEWS.d/next/Core and Builtins/2018-06-07-20-18-38.bpo-33803.n-Nq6_.rst
new file mode 100644 (file)
index 0000000..9cb8457
--- /dev/null
@@ -0,0 +1,2 @@
+Fix a crash in hamt.c caused by enabling GC tracking for an object that
+hadn't all of its fields set to NULL.
index 52171222b005ee82602922949010fbbdaf730275..f8bce5961afc61f87bbc33f715d0ab8c09852d30 100644 (file)
@@ -2476,6 +2476,8 @@ hamt_alloc(void)
     if (o == NULL) {
         return NULL;
     }
+    o->h_count = 0;
+    o->h_root = NULL;
     o->h_weakreflist = NULL;
     PyObject_GC_Track(o);
     return o;