[PATCH] libelf: If e_phnum is zero then set e_phoff also to zero.
Mark Wielaard
mjw at redhat.com
Mon May 18 13:53:08 UTC 2015
On Wed, 2015-05-13 at 15:25 +0200, Mark Wielaard wrote:
> If phnum is zero make sure e_phoff is also zero and not some random value.
> That would cause trouble in update_file. This could happen when ELF_F_LAYOUT
> is set and the user copied over a ehdr from a bogus ELF file where the phdrs
> are unreadable. In that case trying to write out the new ELF image would
> crash trying to follow the bogus e_phdr value.
Pushed to master.
More information about the elfutils-devel
mailing list