From ddd640bff2e1366ce80720f0c5bc5c42326f1263 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 3 Aug 2009 09:15:09 +0000 Subject: * thread.c (recursive_push): untrust internal hash to prevent unexpected SecurityError. a patch from Kazuhiro NISHIYAMA. Fix: #1864 [ruby-dev:38982] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'thread.c') diff --git a/thread.c b/thread.c index c6f9cea24..3870fc19a 100644 --- a/thread.c +++ b/thread.c @@ -3362,6 +3362,7 @@ recursive_push(VALUE hash, VALUE obj, VALUE paired_obj) } if (NIL_P(list) || TYPE(list) != T_HASH) { list = rb_hash_new(); + OBJ_UNTRUST(list); rb_hash_aset(hash, sym, list); } if (!paired_obj) { @@ -3374,6 +3375,7 @@ recursive_push(VALUE hash, VALUE obj, VALUE paired_obj) if (TYPE(pair_list) != T_HASH){ VALUE other_paired_obj = pair_list; pair_list = rb_hash_new(); + OBJ_UNTRUST(pair_list); rb_hash_aset(pair_list, other_paired_obj, Qtrue); rb_hash_aset(list, obj, pair_list); } -- cgit