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

  1. if (info_ptr >= info_ptr_end): 当 info_ptr 超出了 info_ptr_end,info_ptr 将为空指针。

  2. abbrev = lookup_abbrev (abbrev_number, unit->abbrevs); 如果 abbrev 为 NULL,则会在后续的代码中使用该空指针,导致程序崩溃。

  3. var = (struct varinfo *) bfd_zalloc (abfd, amt); 如果 var 为 NULL,则会在后续的代码中使用该空指针,导致程序崩溃。

  4. func = (struct funcinfo *) bfd_zalloc (abfd, amt); 如果 func 为 NULL,则会在后续的代码中使用该空指针,导致程序崩溃。

  5. info_ptr = read_attribute (&attr, &abbrev->attrs[i], unit, info_ptr, info_ptr_end); 如果 read_attribute 返回空指针,则会在后续的代码中使用该空指针,导致程序崩溃。

  6. if (!find_abstract_instance (unit, info_ptr, &attr, &func->name, &func->is_linkage, &func->file, &func->line)) goto fail; 如果 find_abstract_instance 返回 FALSE,则会跳转到 fail 标签处,而在 fail 标签处会关闭文件并释放资源,此时如果 func 不为 NULL,则会引发错误。

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

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

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

联系我们

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

微信号:3007537140

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

关注我们
x

注册

已经有帐号?