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

Merge pull request #2199 from cremno/use-memmove

fix memcpy-param-overlap
parents 02cabf8f 8876c059
......@@ -5466,7 +5466,7 @@ mrb_parser_set_filename(struct mrb_parser_state *p, const char *f)
new_table = (mrb_sym*)parser_palloc(p, sizeof(mrb_sym) * p->filename_table_length);
if (p->filename_table) {
memcpy(new_table, p->filename_table, sizeof(mrb_sym) * p->filename_table_length);
memmove(new_table, p->filename_table, sizeof(mrb_sym) * p->filename_table_length);
}
p->filename_table = new_table;
p->filename_table[p->filename_table_length - 1] = sym;
......
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