From abfaac7a6cbdbfad9e7c05bc5ebcb4df57906fcb Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 30 May 2001 09:12:34 +0000 Subject: * ruby.c (proc_options): unexpected SecurityError happens when -T4. * regex.c (re_compile_pattern): * \1 .. \9 should be backreferences always. * regex.c (re_match): backreferences corresponding to unclosed/unmatched parentheses should fail always. * string.c (rb_str_cat): use rb_str_buf_cat() if possible. [new] * string.c (rb_str_append): ditto. * string.c (rb_str_buf_cat): remove unnecessary check (type, taint, modify) to gain performance. * string.c (rb_str_buf_append): ditto. * string.c (rb_str_buf_new): buffering string function. [new] * string.c (rb_str_buf_append): ditto. * string.c (rb_str_buf_cat): ditto. * time.c (make_time_t): local time adjustment revised. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 2c3102ed59..e0108299ee 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; -- cgit v1.2.3