Skip to content

Commit 378c53c

Browse files
authored
bpo-33803: Fix a crash in hamt.c (#7504)
1 parent c4f3cb7 commit 378c53c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a crash in hamt.c caused by enabling GC tracking for an object that
2+
hadn't all of its fields set to NULL.

Python/hamt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,6 +2476,8 @@ hamt_alloc(void)
24762476
if (o == NULL) {
24772477
return NULL;
24782478
}
2479+
o->h_count = 0;
2480+
o->h_root = NULL;
24792481
o->h_weakreflist = NULL;
24802482
PyObject_GC_Track(o);
24812483
return o;

0 commit comments

Comments
 (0)