Commit dd5ccb6c authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1763 from cubicdaiya/issues/mrb_str_new_static_bug

fix SEGV bug for mrb_str_new_static
parents 25822f24 8336072e
......@@ -256,6 +256,9 @@ mrb_value
mrb_str_new_static(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 = mrb_obj_alloc_string(mrb);
s->len = len;
......
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