ZBLOG

static bfd_boolean scan_unit_for_symbols (struct comp_unit *unit) { bfd *abfd = unit->abfd; bfd_byte *info_ptr = unit->first_child_die_ptr; bfd_byte *info_ptr_end = unit->stash->info_ptr_end; int nesting_level = 0; struct nest_f

在第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;
    }

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://sdn.0voice.com/?id=228

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?