merge revision(s) 49792: [Backport #10918]

* gc.c (id2ref): prohibit from accessing internal objects.
	  [ruby-core:68348] [Bug #10918]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2015-05-21 00:49:44 +00:00
parent f1cb00f82e
commit bf8a18ac9a
3 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Thu May 21 09:49:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (id2ref): prohibit from accessing internal objects.
[ruby-core:68348] [Bug #10918]
Thu May 21 09:46:58 2015 Rei Odaira <Rei.Odaira@gmail.com>
* ext/pty/pty.c: AIX supports autopush.

3
gc.c
View file

@ -2332,6 +2332,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;
}

View file

@ -1,6 +1,6 @@
#define RUBY_VERSION "2.1.7"
#define RUBY_RELEASE_DATE "2015-05-21"
#define RUBY_PATCHLEVEL 346
#define RUBY_PATCHLEVEL 347
#define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 5