summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-04-03 20:23:39 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-04-03 20:23:39 +0900
commit19c3c957fc195fdf0b90d84d1e4e8307594efc80 (patch)
tree30c25461b3121c2a8f1f736f8827184437439981 /src
parent653ddd6d3e8da23b0c7a7e85a199ae32486bdbba (diff)
downloadmruby-19c3c957fc195fdf0b90d84d1e4e8307594efc80.tar.gz
mruby-19c3c957fc195fdf0b90d84d1e4e8307594efc80.zip
add assertion before casting
Diffstat (limited to 'src')
-rw-r--r--src/codegen.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/codegen.c b/src/codegen.c
index 418e1f371..c869285d9 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -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';