From 94e6598969b76d613188ae9015e5d02f31c622a0 Mon Sep 17 00:00:00 2001 From: usa Date: Mon, 27 Aug 2018 14:15:43 +0000 Subject: merge revision(s) 64071: [Backport #14941] ruby.c: taint ARGV on Windows * ruby.c (external_str_new_cstr): strings come from the external should be tainted. [ruby-dev:50596] [Bug #14941] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@64563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_rubyoptions.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 1ea1115aa5..d6db01e6a0 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -920,4 +920,11 @@ class TestRubyOptions < Test::Unit::TestCase end end end + + def test_argv_tainted + assert_separately(%w[- arg], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + assert_predicate(ARGV[0], :tainted?, '[ruby-dev:50596] [Bug #14941]') + end; + end end -- cgit v1.2.3