Skip to content
Snippets Groups Projects
Commit f5cd92a8 authored by Ty Smith's avatar Ty Smith Committed by Brad King
Browse files

cmELF: Avoid divide by zero if there are no dynamic section entries

parent b4a2ada2
No related branches found
No related tags found
No related merge requests found
......@@ -567,8 +567,14 @@ bool cmELFInternalImpl<Types>::LoadDynamicSection()
return true;
}
// Allocate the dynamic section entries.
// If there are no entries we are done.
ELF_Shdr const& sec = this->SectionHeaders[this->DynamicSectionIndex];
if(sec.sh_entsize == 0)
{
return false;
}
// Allocate the dynamic section entries.
int n = static_cast<int>(sec.sh_size / sec.sh_entsize);
this->DynamicSectionEntries.resize(n);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment