diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gc.c | 3 |
2 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Sun Mar 1 11:17:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * gc.c (id2ref): prohibit from accessing internal objects. + [ruby-core:68348] [Bug #10918] + Sun Mar 1 09:06:11 2015 Tanaka Akira <akr@fsij.org> * lib/time.rb (strptime): Support %s.%N. @@ -2761,6 +2761,9 @@ id2ref(VALUE obj, VALUE objid) if (!is_live_object(objspace, ptr)) { rb_raise(rb_eRangeError, "%p is recycled object", p0); } + if (RBASIC(ptr)->klass == 0) { + rb_raise(rb_eRangeError, "%p is internal object", p0); + } return (VALUE)ptr; } |