From 30a7225bab574d7fea1f94325c8fd9f857199bbf Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 7 Jul 2009 03:55:18 +0000 Subject: * enum.c (rb_enum_join): should propagate taint to the return value. the change was overridden by r23967. [ruby-core:24176] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- enum.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'enum.c') diff --git a/enum.c b/enum.c index 09ca85d93..bb480ba9e 100644 --- a/enum.c +++ b/enum.c @@ -1825,10 +1825,14 @@ VALUE rb_enum_join(VALUE obj, VALUE sep) { VALUE args[2]; + args[0] = 0; args[1] = sep; rb_block_call(obj, id_each, 0, 0, join_i, (VALUE)args); - return args[0] ? args[0] : rb_str_new(0, 0); + if (!args[0]) args[0] = rb_str_new(0, 0); + OBJ_INFECT(args[0], obj); + + return args[0]; } /* -- cgit