From 405b5272766ae305c0e54267923c6950a739c262 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 25 Nov 2008 14:29:39 +0000 Subject: [PATCH] * array.c (rb_ary_times): taint (and untrust) status should be inherited by "ary * 0". [ruby-dev:37024] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ array.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2496c6de0e..b43b00a1b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Nov 25 16:26:12 2008 Yukihiro Matsumoto + + * array.c (rb_ary_times): taint (and untrust) status should be + inherited by "ary * 0". [ruby-dev:37024] + Tue Nov 25 15:54:07 2008 Yukihiro Matsumoto * strftime.c (rb_strftime): should not swallow incomplete diff --git a/array.c b/array.c index 5553b8ff2f..578f7fae90 100644 --- a/array.c +++ b/array.c @@ -2551,7 +2551,10 @@ rb_ary_times(VALUE ary, VALUE times) } len = NUM2LONG(times); - if (len == 0) return ary_new(rb_obj_class(ary), 0); + if (len == 0) { + ary2 = ary_new(rb_obj_class(ary), 0); + goto out; + } if (len < 0) { rb_raise(rb_eArgError, "negative argument"); } @@ -2566,6 +2569,7 @@ rb_ary_times(VALUE ary, VALUE times) for (i=0; i