We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f0b6281 + 8ba8702 commit 677e6b8Copy full SHA for 677e6b8
ext/msgpack/unpacker.c
@@ -336,7 +336,8 @@ static int read_raw_body_cont(msgpack_unpacker_t* uk)
336
size_t length = uk->reading_raw_remaining;
337
338
if(uk->reading_raw == Qnil) {
339
- uk->reading_raw = rb_str_buf_new(length);
+ size_t buffered_size = msgpack_buffer_all_readable_size(UNPACKER_BUFFER_(uk));
340
+ uk->reading_raw = rb_str_buf_new(length > buffered_size ? buffered_size : length);
341
}
342
343
do {
0 commit comments