Permalink
Browse files

Thread.abort_on_exception= should raise SecurityError when $SAFE is 4

  • Loading branch information...
1 parent 756cc28 commit 2982681462a55d4fc3c099b86e62d63def80ce4c @Watson1978 Watson1978 committed Feb 1, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 thread.c
View
@@ -577,6 +577,7 @@ rb_thread_s_abort_exc(VALUE rcv, SEL sel)
static VALUE
rb_thread_s_abort_exc_set(VALUE self, SEL sel, VALUE val)
{
+ rb_secure(4);
rb_vm_set_abort_on_exception(RTEST(val));
return val;
}
@@ -608,6 +609,7 @@ rb_thread_abort_exc(VALUE thread, SEL sel)
static VALUE
rb_thread_abort_exc_set(VALUE thread, SEL sel, VALUE val)
{
+ rb_secure(4);
GetThreadPtr(thread)->abort_on_exception = RTEST(val);
return val;
}

0 comments on commit 2982681

Please sign in to comment.