FIX: IO#sysread occurs SEGV

This commit is contained in:
TOMITA Masahiro
2014-12-15 20:24:01 +09:00
parent d1fee5892a
commit be9e203563
+1 -1
View File
@@ -420,7 +420,7 @@ mrb_io_sysread(mrb_state *mrb, mrb_value io)
}
if (mrb_nil_p(buf)) {
buf = mrb_str_new(mrb, "", maxlen);
buf = mrb_str_new(mrb, NULL, maxlen);
}
if (RSTRING_LEN(buf) != maxlen) {
buf = mrb_str_resize(mrb, buf, maxlen);