aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-27 05:42:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-27 05:42:56 +0000
commit9fbb66610c357cf2396620620f2fa2253939827e (patch)
tree7d28cf87e8ba832e9431094cae9f76646c436032 /ruby.c
parentc0e478ed75c646aad2b51e25bfc86c663d9cf3ca (diff)
downloadruby-9fbb66610c357cf2396620620f2fa2253939827e.tar.gz
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/trunk@64071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index 7e64d081a9..d0f66dcd6d 100644
--- a/ruby.c
+++ b/ruby.c
@@ -2186,7 +2186,9 @@ external_str_new_cstr(const char *p)
{
#if UTF8_PATH
VALUE str = rb_utf8_str_new_cstr(p);
- return str_conv_enc(str, NULL, rb_default_external_encoding());
+ str = str_conv_enc(str, NULL, rb_default_external_encoding());
+ OBJ_TAINT_RAW(str);
+ return str;
#else
return rb_external_str_new_cstr(p);
#endif