From e2fd80b3d3b7f8ca7ffc2e7286fdb59e0c44bc79 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 17 Jul 2011 07:26:45 +0000 Subject: * error.c (rb_check_trusted): new function to check an object is trusted. * struct.c (rb_struct_modify), time.c (time_modify): check by the above function to show proper class names. [Bug #5036] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- struct.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'struct.c') diff --git a/struct.c b/struct.c index 136ba0acee..ab82fadd1c 100644 --- a/struct.c +++ b/struct.c @@ -153,8 +153,7 @@ static void rb_struct_modify(VALUE s) { rb_check_frozen(s); - if (!OBJ_UNTRUSTED(s) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't modify Struct"); + rb_check_trusted(s); } static VALUE -- cgit v1.2.1