diff options
author | Samuel Williams <[email protected]> | 2021-11-15 15:28:02 +1300 |
---|---|---|
committer | Samuel Williams <[email protected]> | 2021-11-17 10:39:54 +1300 |
commit | 5190926e40febeeb3822b8bd7c031b06279dc3f1 (patch) | |
tree | 039bbc39ede56a6b3e0f2f707d22753ed0d4e474 /io_buffer.c | |
parent | a19a657514a384a6c36cb62a2b4eb5352fb3074e (diff) |
Validate string type when constructing IO::Buffer for string mapping.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5115
Diffstat (limited to 'io_buffer.c')
-rw-r--r-- | io_buffer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/io_buffer.c b/io_buffer.c index 45dbfd02da..bd902ed8d4 100644 --- a/io_buffer.c +++ b/io_buffer.c @@ -259,6 +259,8 @@ rb_io_buffer_type_allocate(VALUE self) VALUE rb_io_buffer_type_for(VALUE klass, VALUE string) { + StringValue(string); + VALUE instance = rb_io_buffer_type_allocate(klass); struct rb_io_buffer *data = NULL; |