diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | io.c | 1 | ||||
-rw-r--r-- | test/ruby/test_io.rb | 6 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 12 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Sun Jul 19 17:32:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * io.c (io_read): should taint the result. [ruby-dev:38826] + Sat Jul 18 23:44:59 2009 NARUSE, Yui <naruse@ruby-lang.org> * re.c (reg_enc_error): use rb_enc_get to get the encoding of @@ -1998,6 +1998,7 @@ io_read(int argc, VALUE *argv, VALUE io) return Qnil; } rb_str_resize(str, n); + OBJ_TAINT(str); return str; } diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 776cf34147..04c0b55533 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1368,4 +1368,10 @@ class TestIO < Test::Unit::TestCase } } end + + def test_tainted + t = make_tempfile + assert(File.read(t.path, 4).tainted?, '[ruby-dev:38826]') + assert(File.open(t.path) {|f| f.read(4)}.tainted?, '[ruby-dev:38826]') + end end @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 247 +#define RUBY_PATCHLEVEL 248 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |