Skip to content

Commit

Permalink
Merge pull request #93 from fix-89-tainted-expression
Browse files Browse the repository at this point in the history
Fix #89, Check get_sh_entsize(SectionHeader) value
  • Loading branch information
astrogeco committed Nov 3, 2021
2 parents 10f55fb + 7fcf9ac commit 5467a3a
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 5467a3a

Please sign in to comment.