diff options
author | Samuel Williams <[email protected]> | 2021-12-20 09:03:52 +1300 |
---|---|---|
committer | Samuel Williams <[email protected]> | 2021-12-21 12:25:42 +1300 |
commit | 9de5c4ec761aad3edc50b38d9824b40665d18911 (patch) | |
tree | f20883478bf71426ca3698e150ca7ac3927a0eeb /io_buffer.c | |
parent | 6ad8cf70713e6ae91a8218d4e0034ebbc1983c69 (diff) |
Fix mapping invalid non-file object.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5303
Diffstat (limited to 'io_buffer.c')
-rw-r--r-- | io_buffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/io_buffer.c b/io_buffer.c index 524756e041..a97c687239 100644 --- a/io_buffer.c +++ b/io_buffer.c @@ -322,6 +322,9 @@ io_buffer_map(int argc, VALUE *argv, VALUE klass) } VALUE io = argv[0]; + if (!RB_TYPE_P(io, T_FILE)) { + rb_raise(rb_eArgError, "Must be file/io!"); + } size_t size; if (argc >= 2) { |