summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/io.c b/io.c
index 626cee7934..8394f9768b 100644
--- a/io.c
+++ b/io.c
@@ -143,6 +143,15 @@ rb_eof_error()
rb_raise(rb_eEOFError, "End of file reached");
}
+VALUE
+rb_io_taint_check(io)
+ VALUE io;
+{
+ if (!OBJ_TAINTED(io) && rb_safe_level() >= 4)
+ rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
+ return io;
+}
+
void
rb_io_check_closed(fptr)
OpenFile *fptr;