Commit 25822f24 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1762 from cubicdaiya/issues/mrb_str_new_bug

fix SEGV bug for mrb_str_new
parents 90c54d1e 30fe3f5d
......@@ -216,6 +216,9 @@ mrb_value
mrb_str_new(mrb_state *mrb, const char *p, size_t len)
{
struct RString *s;
if ((mrb_int)len < 0) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "negative string size (or size too big)");
}
s = str_new(mrb, p, len);
return mrb_obj_value(s);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment