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

Merge pull request #1799 from cubicdaiya/issues/off_by_one_error2

fix off-by-one error in attrsym
parents ba608fb3 016d3b93
......@@ -704,7 +704,11 @@ attrsym(codegen_scope *s, mrb_sym a)
char *name2;
name = mrb_sym2name_len(s->mrb, a, &len);
name2 = (char *)codegen_palloc(s, len+1);
name2 = (char *)codegen_palloc(s,
len
+ 1 /* '=' */
+ 1 /* '\0' */
);
memcpy(name2, name, 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