Raise an exception when transfer arguments are too many; fix
The fix was proposed by  Thank you.
@@ -188,9 +188,13 @@ fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mr
mrb->c->status = resume ? MRB_FIBER_RESUMED : MRB_FIBER_TRANSFERRED;
c->prev = resume ? mrb->c : (c->prev ? c->prev : mrb->root_c);
if (c->status == MRB_FIBER_CREATED) {
- mrb_value *b = c->stack+1;
- mrb_value *e = b + len;
+ mrb_value *b, *e;
+ if (len > c->stend - c->stack) {
+ mrb_raise(mrb, E_FIBER_ERROR, "too many arguments to fiber");
+ }
+ b = c->stack+1;
+ e = b + len;
while (b<e) {
*b++ = *a++;
}
