mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
LibELF: Fix ELF::Image::symbol_count() asserting on section-less ELF
If we have no sections, we also have no symbols, so just return 0. Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28683
This commit is contained in:
parent
ab549cf942
commit
780c64e1f0
1 changed files with 2 additions and 0 deletions
|
@ -76,6 +76,8 @@ StringView Image::section_index_to_string(unsigned index) const
|
|||
unsigned Image::symbol_count() const
|
||||
{
|
||||
ASSERT(m_valid);
|
||||
if (!section_count())
|
||||
return 0;
|
||||
return section(m_symbol_table_section_index).entry_count();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue