Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #89, Check get_sh_entsize(SectionHeader) value #93

Merged
merged 1 commit into from
Dec 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix #89, Check get_sh_entsize(SectionHeader) value
  • Loading branch information
arielswalker committed Oct 12, 2021
commit 7fcf9ac24ad1148194f7621ad88f46b056268d6c
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