summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-21 00:49:44 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-21 00:49:44 +0000
commitbf8a18ac9a19b78a968e0ecd217f0c64d7c2d24e (patch)
tree2a1bf1f427ff9899ab1061cbaac944228834821c
parentf1cb00f82ec567b4d61df0435fbc357efeb7cc00 (diff)
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
-rw-r--r--ChangeLog5
-rw-r--r--gc.c3
-rw-r--r--version.h2
3 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b1be1c5a9..4c7f624f7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/gc.c b/gc.c
index f9048e031a..785a50d0ea 100644
--- a/gc.c
+++ b/gc.c
@@ -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;
}
diff --git a/version.h b/version.h
index e9e6afe790..4fc99cfb49 100644
--- a/version.h
+++ b/version.h
@@ -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