Skip to content

Commit

Permalink
* enum.c (enum_to_a): should propagate taint to the return value.
Browse files Browse the repository at this point in the history
  [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
  • Loading branch information
matz committed Jul 6, 2009
1 parent 06b9094 commit 8c7f7c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 8c7f7c2

Please sign in to comment.