1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* enum.c (enum_to_a): should propagate taint to the return value.

[ruby-core:24152]

* enum.c (enum_sort_by): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2009-07-06 01:03:16 +00:00
parent 06b9094f96
commit 8c7f7c29b4
2 changed files with 11 additions and 0 deletions

View file

@ -19,6 +19,13 @@ Mon Jul 6 09:04:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enum.c (enum_join): deals with self recursive objects to get rid
of infinite recursion. [ruby-core:24150]
Mon Jul 6 08:00:10 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* enum.c (enum_to_a): should propagate taint to the return value.
[ruby-core:24152]
* enum.c (enum_sort_by): ditto.
Mon Jul 6 00:41:41 2009 Tadayoshi Funaba <tadf@dotrb.org>
* rational.c: edited rdoc.

4
enum.c
View file

@ -412,6 +412,7 @@ enum_to_a(int argc, VALUE *argv, VALUE obj)
VALUE ary = rb_ary_new();
rb_block_call(obj, id_each, argc, argv, collect_all, ary);
OBJ_INFECT(ary, obj);
return ary;
}
@ -605,6 +606,7 @@ enum_group_by(VALUE obj)
hash = rb_hash_new();
rb_block_call(obj, id_each, 0, 0, group_by_i, hash);
OBJ_INFECT(hash, obj);
return hash;
}
@ -816,6 +818,8 @@ enum_sort_by(VALUE obj)
RARRAY_PTR(ary)[i] = RNODE(RARRAY_PTR(ary)[i])->u2.value;
}
RBASIC(ary)->klass = rb_cArray;
OBJ_INFECT(ary, obj);
return ary;
}