From 52ebc24487f3d1553c436c3ab9fbf8784379961d Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 7 Nov 2009 11:59:16 +0000 Subject: * vm_insnhelper.c (vm_push_frame): get rid of out-of-bounds access. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_insnhelper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 6d4887024b..0660c7dd03 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -29,7 +29,9 @@ vm_push_frame(rb_thread_t * th, const rb_iseq_t * iseq, rb_control_frame_t * const cfp = th->cfp - 1; int i; - CHECK_STACK_OVERFLOW(th->cfp, local_size); + if ((void *)(sp + local_size) >= (void *)cfp) { + rb_exc_raise(sysstack_error); + } th->cfp = cfp; /* setup vm value stack */ -- cgit v1.2.3