This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] libelf: find 1st section instead of assuming
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Thu, 23 Jun 2016 17:12:42 +0200
- Subject: Re: [PATCH] libelf: find 1st section instead of assuming
Hi John,
On Thu, 2016-06-23 at 16:03 +0200, John Ogness wrote:
> When getting section headers it is assumed that the first section
> is on the first section list. However, it is possible that the
> first section list only contains the zeroth section, in which
> case either illegal memory access occurs or elf_nextscn()
> erroneously returns NULL.
>
> With this patch, checks are added to avoid the illegal memory
> access and (if available) the second section list is looked at
> to find the first section.
Both changes to updatenull and nextscn do make sense to me.
I assume this wasn't just theoretical? I didn't immediately see how this
situation occurs. Do you happen to have an example/testcase?
Thanks,
Mark