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

Merge pull request #2540 from cubicdaiya/issues/read_irep_record_error_handlings

Fix error hanldlings in read_irep_record().
parents c7fda223 ff958283
......@@ -164,11 +164,18 @@ read_irep_record(mrb_state *mrb, const uint8_t *bin, size_t *len, mrb_bool alloc
mrb_irep *irep = read_irep_record_1(mrb, bin, len, alloc);
size_t i;
if (irep == NULL) {
return NULL;
}
bin += *len;
for (i=0; i<irep->rlen; i++) {
size_t rlen;
irep->reps[i] = read_irep_record(mrb, bin, &rlen, alloc);
if (irep->reps[i] == NULL) {
return NULL;
}
bin += rlen;
*len += rlen;
}
......
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