From 5190926e40febeeb3822b8bd7c031b06279dc3f1 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 15 Nov 2021 15:28:02 +1300 Subject: Validate string type when constructing IO::Buffer for string mapping. --- io_buffer.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'io_buffer.c') 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; -- cgit v1.2.3