aboutsummaryrefslogtreecommitdiffstats
path: root/marshal.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-13 05:12:55 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-13 05:12:55 +0000
commit0ac361f54060a26f771d8751f06bbd1013db2016 (patch)
tree12e63623bff4beb8561fd447d8c0e786f6abaad2 /marshal.c
parentbfb08c1ece75101e36caef2a87ca74a3e07e92d4 (diff)
downloadruby-0ac361f54060a26f771d8751f06bbd1013db2016.tar.gz
* marshal.c (r_entry0): don't taint classes and modules because
Marshal.load just return the dumped classes and modules. [Bug #7325] [ruby-core:49198] * test/ruby/test_marshal.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/marshal.c b/marshal.c
index 061a8d5f31..8c60e5d80a 100644
--- a/marshal.c
+++ b/marshal.c
@@ -1323,7 +1323,8 @@ r_entry0(VALUE v, st_index_t num, struct load_arg *arg)
else {
st_insert(arg->data, num, (st_data_t)v);
}
- if (arg->infection) {
+ if (arg->infection &&
+ TYPE(v) != T_CLASS && TYPE(v) != T_MODULE) {
FL_SET(v, arg->infection);
if ((VALUE)real_obj != Qundef)
FL_SET((VALUE)real_obj, arg->infection);