summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2025-09-02 14:30:23 +0200
committerPeter Zhu <peter@peterzhu.ca>2025-09-09 01:18:41 +0200
commit8d79187523cdc0b5b961f4e856df8824c241f16e (patch)
treee25c807940027d4154c4b02b01088c0e39064e37 /variable.c
parenta3eb4601e86ccfca798995860a5bcfb38dd13789 (diff)
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.
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/variable.c b/variable.c
index cccb09e329..ef35cf3990 100644
--- a/variable.c
+++ b/variable.c
@@ -1150,7 +1150,7 @@ rb_alias_variable(ID name1, ID name2)
RB_VM_LOCKING() {
entry2 = rb_global_entry(name2);
if (!rb_id_table_lookup(gtbl, name1, &data1)) {
- entry1 = ALLOC(struct rb_global_entry);
+ entry1 = ZALLOC(struct rb_global_entry);
entry1->id = name1;
rb_id_table_insert(gtbl, name1, (VALUE)entry1);
}