summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-26 15:32:28 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-26 15:32:28 +0000
commit1201652aced9da0d6f578bc707d77ee5017d3295 (patch)
treec0cac59a4f29c9a1ad7f77457378f89b06f7b1c6
parent12265cfd3dcf0e188d7d2d332641cc5e4288f92b (diff)
merges r24203 from trunk into ruby_1_9_1.
-- * io.c (io_read): should taint the result. [ruby-dev:38826] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--io.c1
-rw-r--r--test/ruby/test_io.rb6
-rw-r--r--version.h2
4 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c97aa0043..974d4aa5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/io.c b/io.c
index e38d73acd..48a639212 100644
--- a/io.c
+++ b/io.c
@@ -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 776cf3414..04c0b5553 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
diff --git a/version.h b/version.h
index 08c8212e6..59540f353 100644
--- a/version.h
+++ b/version.h
@@ -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