mirror of
https://github.com/QuasarApp/LIEF.git
synced 2025-04-28 05:14:33 +00:00
Merge pull request #419 from kohnakagawa/fix/handle_empty_group_icon
fix to avoid SIGSEGV while parsing the file that has an empty group icon
This commit is contained in:
commit
67f04bfd38
@ -765,7 +765,16 @@ std::vector<ResourceIcon> ResourcesManager::icons(void) const {
|
||||
for (const ResourceNode& grp_icon_lvl2 : it_grp_icon->childs()) {
|
||||
for (const ResourceNode& grp_icon_lvl3 : grp_icon_lvl2.childs()) {
|
||||
const ResourceData* icon_group_node = dynamic_cast<const ResourceData*>(&grp_icon_lvl3);
|
||||
if (!icon_group_node) {
|
||||
LOG(ERROR) << "Group icon node is null";
|
||||
continue;
|
||||
}
|
||||
|
||||
const std::vector<uint8_t>& icon_group_content = icon_group_node->content();
|
||||
if (icon_group_content.empty()) {
|
||||
LOG(ERROR) << "Group icon is empty";
|
||||
continue;
|
||||
}
|
||||
|
||||
const pe_resource_icon_dir* group_icon_header = reinterpret_cast<const pe_resource_icon_dir*>(icon_group_content.data());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user