Fix infinite loop in dwarf parser

This commit is contained in:
pancake 2014-11-05 02:51:05 +01:00
parent 7af9bf009a
commit f492ba59a2
1 changed files with 4 additions and 1 deletions

View File

@ -1260,6 +1260,7 @@ static const ut8 *r_bin_dwarf_parse_comp_unit(Sdb *s, const ut8 *obuf,
if (!abbr_code) {
cu->dies[cu->length].abbrev_code = 0;
cu->length++;
buf++;
continue;
}
@ -1370,8 +1371,10 @@ static RBinDwarfDebugAbbrev *r_bin_dwarf_parse_abbrev_raw(const ut8 *obuf, size_
while (buf < buf_end) {
offset = buf - obuf;
buf = r_uleb128 (buf, -1, &tmp);
if (!tmp)
if (!tmp) {
buf++;
continue;
}
if (da->length == da->capacity)
r_bin_dwarf_expand_debug_abbrev(da);