diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-12-14 06:50:43 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-12-14 06:50:43 +0000 |
commit | 9d228b13deccfdf23f44e2c465f723a2a7b3bcbd (patch) | |
tree | 9a4d769804c389b6b03bbfdf65e8e0a03288c8e8 /hash.c | |
parent | c18d3740a925e8752c3b93acea6087fb0e03be53 (diff) |
19991214
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; } |