add assertion before casting

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-04-03 20:23:39 +09:00
parent 653ddd6d3e
commit 19c3c957fc
+1
View File
@@ -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';