summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-07 03:55:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-07 03:55:18 +0000
commit9041ac4289cc88751d4d7d492f0402c13fac3057 (patch)
treef8c822544c55f305c3053aec92c0ba0c201a1761
parent450f7842160237a533d90c0f94384f8c2a73253a (diff)
* enum.c (rb_enum_join): should propagate taint to the return
value. the change was overridden by r23967. [ruby-core:24176] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--enum.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 130336bdf0..f6728bb5a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jul 7 12:47:28 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * enum.c (rb_enum_join): should propagate taint to the return
+ value. the change was overridden by r23967. [ruby-core:24176]
+
Tue Jul 7 11:56:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (GC_PROF_SET_MALLOC_INFO, GC_PROF_SET_HEAP_INFO): simplified.
diff --git a/enum.c b/enum.c
index 09ca85d930..bb480ba9ea 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];
}
/*