Commit 6af8cc36 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #3366 from ksss/splice

Check array max size
parents 30d5424a caba1a19
......@@ -619,6 +619,10 @@ mrb_ary_splice(mrb_state *mrb, mrb_value ary, mrb_int head, mrb_int len, mrb_val
size = head + argc;
if (tail < a->len) size += a->len - tail;
if (size < 0 || size > ARY_MAX_SIZE)
mrb_raise(mrb, E_ARGUMENT_ERROR, "array size too big");
if (size > a->aux.capa)
ary_expand_capa(mrb, a, size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment