add assertion before casting

parent 653ddd6d
......@@ -719,6 +719,7 @@ attrsym(codegen_scope *s, mrb_sym a)
+ 1 /* '=' */
+ 1 /* '\0' */
);
mrb_assert(len <= SIZE_MAX);
memcpy(name2, name, (size_t)len);
name2[len] = '=';
name2[len+1] = '\0';
......
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