summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ruby.c b/ruby.c
index 2c3102ed594..e0108299ee8 100644
--- a/ruby.c
+++ b/ruby.c
@@ -681,6 +681,11 @@ proc_options(argc, argv)
ruby_show_copyright();
}
+ if (rb_safe_level() >= 4) {
+ OBJ_TAINT(rb_argv);
+ OBJ_TAINT(rb_load_path);
+ }
+
if (!e_script && argc == 0) { /* no more args */
if (verbose) exit(0);
script = "-";
@@ -726,6 +731,11 @@ proc_options(argc, argv)
process_sflag();
xflag = 0;
+
+ if (rb_safe_level() >= 4) {
+ FL_UNSET(rb_argv, FL_TAINT);
+ FL_UNSET(rb_load_path, FL_TAINT);
+ }
}
extern int ruby__end__seen;