mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* array.c (inspect_ary): don't taint the inspected result of a
recursive array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a8f5a06a68
commit
366e1c3884
3 changed files with 6 additions and 9 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Feb 14 15:00:16 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* array.c (inspect_ary): don't taint the inspected result of a
|
||||
recursive array.
|
||||
|
||||
Tue Feb 15 15:43:29 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* encoding.c (rb_enc_compatible): change the rule for empty strings:
|
||||
|
|
2
array.c
2
array.c
|
@ -1743,7 +1743,7 @@ inspect_ary(VALUE ary, VALUE dummy, int recur)
|
|||
long i;
|
||||
VALUE s, str;
|
||||
|
||||
if (recur) return rb_tainted_str_new2("[...]");
|
||||
if (recur) return rb_usascii_str_new_cstr("[...]");
|
||||
str = rb_str_buf_new2("[");
|
||||
for (i=0; i<RARRAY_LEN(ary); i++) {
|
||||
s = rb_inspect(RARRAY_PTR(ary)[i]);
|
||||
|
|
|
@ -1693,14 +1693,6 @@ class TestString < Test::Unit::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
def test_tainted_str_new
|
||||
a = []
|
||||
a << a
|
||||
s = a.inspect
|
||||
assert(s.tainted?)
|
||||
assert_equal("[[...]]", s)
|
||||
end
|
||||
|
||||
class S2 < String
|
||||
end
|
||||
def test_str_new4
|
||||
|
|
Loading…
Add table
Reference in a new issue