summaryrefslogtreecommitdiffhomepage
path: root/src/codegen.c
diff options
context:
space:
mode:
authorGo Saito <[email protected]>2015-02-23 11:25:21 +0900
committerGo Saito <[email protected]>2015-02-23 11:25:21 +0900
commit42d23084b72541b74e9f4cc279afc5f89f89d4e1 (patch)
tree8e40180b2bda2f56932bf481ebde6bb98fa5de61 /src/codegen.c
parent44d8a40bac9b900b754bc78167939a74d5efd2d0 (diff)
downloadmruby-42d23084b72541b74e9f4cc279afc5f89f89d4e1.tar.gz
mruby-42d23084b72541b74e9f4cc279afc5f89f89d4e1.zip
fix pointer dereference after realloc
In src/vm.c: mrb_funcall_with_block stack_extend may realloc mrb->c->stbase, if argv points on mruby's stack, then it points invalid address after stack_extend. e.g. src/class.c: mrb_instance_new This code: ```ruby class A def initialize(a0,a1,a2,a3,a4) a0.is_a? Array end end def f(a0,a1,a2,a3,a4) A.new(a0,a1,a2,a3,a4) f(a0,a1,a2,a3,a4) end f(0,1,2,3,4) ``` is expected to get exception ``` stack level too deep. (limit=(0x40000 - 128)) (SystemStackError) ``` but get segfault. Signed-off-by: Go Saito <[email protected]>
Diffstat (limited to 'src/codegen.c')
0 files changed, 0 insertions, 0 deletions