Skip to content

Commit

Permalink
Fix #89, Check get_sh_entsize(SectionHeader) value
Browse files Browse the repository at this point in the history
  • Loading branch information
arielswalker committed Oct 12, 2021
1 parent 2b68c4b commit 7fcf9ac
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion elf2cfetbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,14 @@ int32 GetSectionHeader(int32 SectionIndex, union Elf_Shdr *SectionHeader)
SymbolTableDataOffset = SectionHeader->Shdr64.sh_offset + sizeof(Elf64_Sym);
}
SymbolTableEntrySize = get_sh_entsize(SectionHeader);
NumSymbols = (get_sh_size(SectionHeader) / get_sh_entsize(SectionHeader)) - 1;
if (SymbolTableEntrySize == 0)
{
NumSymbols = 0;
}
else
{
NumSymbols = (get_sh_size(SectionHeader) / SymbolTableEntrySize) - 1;
}
sprintf(VerboseStr, "SHT_SYMTAB (2) - # Symbols = %lu", (long unsigned int)NumSymbols);
break;

Expand Down

0 comments on commit 7fcf9ac

Please sign in to comment.