Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed disclosure of local variables by eval; ref #3710
This patch fixes the latter part of #3710. We need to change
`struct REnv` to fix the former part of the issue.
  • Loading branch information
matz committed Jun 19, 2017
1 parent 4d3027b commit 0de7eec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mrbgems/mruby-eval/src/eval.c
Expand Up @@ -205,9 +205,9 @@ create_proc_from_string(mrb_state *mrb, char *s, int len, mrb_value binding, con
if (!e) e = c->ci[-1].env;
e = (struct REnv*)mrb_obj_alloc(mrb, MRB_TT_ENV, (struct RClass*)e);
e->cxt.c = c;
e->cioff = c->ci - c->cibase - 1;
e->cioff = c->ci - c->cibase;
e->stack = c->ci->stackent;
MRB_SET_ENV_STACK_LEN(e, c->ci[-1].proc->body.irep->nlocals);
MRB_SET_ENV_STACK_LEN(e, c->ci->proc->body.irep->nlocals);
c->ci->target_class = proc->target_class;
c->ci->env = 0;
proc->env = e;
Expand Down

0 comments on commit 0de7eec

Please sign in to comment.