aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/io.c b/io.c
index 22b82bba8d..d682ea288a 100644
--- a/io.c
+++ b/io.c
@@ -6628,6 +6628,7 @@ copy_stream_body(VALUE arg)
stp->close_src = 1;
}
GetOpenFile(src_io, src_fptr);
+ rb_io_check_readable(src_fptr);
src_fd = src_fptr->fd;
}
stp->src_fd = src_fd;
@@ -6660,6 +6661,7 @@ copy_stream_body(VALUE arg)
stp->dst = dst_io;
}
GetOpenFile(dst_io, dst_fptr);
+ rb_io_check_writable(dst_fptr);
dst_fd = dst_fptr->fd;
}
stp->dst_fd = dst_fd;