在第24行加入判断语句,判断info_ptr是否已经超过了info_ptr_end,如果是则跳转到fail标签进行错误处理。具体修改如下:
/* PR 17512: file: 9f405d9d. */
if (info_ptr >= info_ptr_end)
goto fail;
abbrev_number = _bfd_safe_read_leb128 (abfd, info_ptr, &bytes_read,
FALSE, info_ptr_end);
info_ptr += bytes_read;
if (! abbrev_number)
{
nesting_level--;
continue;
}
abbrev = lookup_abbrev (abbrev_number, unit->abbrevs);
if (! abbrev)
{
static unsigned int previous_failed_abbrev = -1U;
/* Avoid multiple reports of the same missing abbrev. */
if (abbrev_number != previous_failed_abbrev)
{
_bfd_error_handler
(_("DWARF error: could not find abbrev number %u"),
abbrev_number);
previous_failed_abbrev = abbrev_number;
}
bfd_set_error (bfd_error_bad_value);
goto fail;
}