summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/io.c b/io.c
index 05b2d45..675f158 100644
--- a/io.c
+++ b/io.c
@@ -9558,6 +9558,9 @@ opt_i_get(ID id, VALUE *var)
static VALUE
argf_inplace_mode_set(VALUE argf, VALUE val)
{
+ if (rb_safe_level() >= 1 && OBJ_TAINTED(val))
+ rb_insecure_operation();
+
if (!RTEST(val)) {
if (ARGF.inplace) free(ARGF.inplace);
ARGF.inplace = 0;