unpackertool/upx/elf: fix #904, prevent possible infinite loop

This commit is contained in:
Peter Matula 2020-12-11 15:22:38 +01:00
parent 06750aa0e4
commit 72a3e9a961

View File

@ -385,7 +385,7 @@ template <int bits> std::uint32_t ElfUpxStub<bits>::getFirstBlockOffset()
itr != end;
++itr)
{
if (baseOffset == (*itr)->getOffset())
if (baseOffset == (*itr)->getOffset() && (*itr)->getSizeInFile() > 0)
{
baseOffset += (*itr)->getSizeInFile();
// Reset back to the beginning, we need to find whether there are