summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-12-14 06:50:43 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-12-14 06:50:43 +0000
commitdbaefe66fe24bd09d20b5aa7dd96eb1a30a2d8c3 (patch)
tree9a4d769804c389b6b03bbfdf65e8e0a03288c8e8 /hash.c
parent14629756b5ad406d295e6d971de5c3e5330bec30 (diff)
downloadruby-dbaefe66fe24bd09d20b5aa7dd96eb1a30a2d8c3.tar.gz
ruby-dbaefe66fe24bd09d20b5aa7dd96eb1a30a2d8c3.tar.xz
ruby-dbaefe66fe24bd09d20b5aa7dd96eb1a30a2d8c3.zip
19991214
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index bebb44b3d..bfead82e8 100644
--- a/hash.c
+++ b/hash.c
@@ -35,7 +35,7 @@ rb_hash_modify(hash)
{
if (FL_TEST(hash, HASH_FREEZE))
rb_raise(rb_eTypeError, "can't modify frozen hash");
- if (!FL_TEST(hash, FL_TAINT) && rb_safe_level() >= 4)
+ if (!OBJ_TAINTED(hash) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify hash");
}
@@ -43,6 +43,9 @@ VALUE
rb_hash_freeze(hash)
VALUE hash;
{
+ if (rb_safe_level() >= 4 && !OBJ_TAINTED(hash))
+ rb_raise(rb_eSecurityError, "Insecure: can't freeze hash");
+
FL_SET(hash, HASH_FREEZE);
return hash;
}