Skip to content

Commit 8d79187

Browse files
committed
Fix undefined behaviour in rb_alias_variable
entry1 is allocated using xmalloc (through ALLOC), which returns undefined memory. We never set the ractor_local field, so the value is undefined.
1 parent a3eb460 commit 8d79187

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

variable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ rb_alias_variable(ID name1, ID name2)
11501150
RB_VM_LOCKING() {
11511151
entry2 = rb_global_entry(name2);
11521152
if (!rb_id_table_lookup(gtbl, name1, &data1)) {
1153-
entry1 = ALLOC(struct rb_global_entry);
1153+
entry1 = ZALLOC(struct rb_global_entry);
11541154
entry1->id = name1;
11551155
rb_id_table_insert(gtbl, name1, (VALUE)entry1);
11561156
}

0 commit comments

Comments
 (0)