This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] libelf: If e_phnum is zero then set e_phoff also to zero.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Mon, 18 May 2015 15:53:08 +0200
- Subject: Re: [PATCH] libelf: If e_phnum is zero then set e_phoff also to zero.
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.