mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fixed heap buffer overflow in mrb_ary_unshift_m; fix #3760
This commit is contained in:
+2
-2
@@ -584,8 +584,8 @@ mrb_ary_unshift_m(mrb_state *mrb, mrb_value self)
|
||||
}
|
||||
array_copy(ptr, vals, alen);
|
||||
ARY_SET_LEN(a, len+alen);
|
||||
while (len--) {
|
||||
mrb_field_write_barrier_value(mrb, (struct RBasic*)a, vals[len]);
|
||||
while (alen--) {
|
||||
mrb_field_write_barrier_value(mrb, (struct RBasic*)a, vals[alen]);
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
Reference in New Issue
Block a user