This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: Make gelf_getphdr more robust?
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 12 Feb 2014 13:15:12 +0100
- Subject: Re: Make gelf_getphdr more robust?
On Fri, 2014-02-07 at 14:28 +0100, Mark Wielaard wrote:
> Could you test against current git with the attached patch? Or could you
> give me access to your crafted ELF file?
Florian sent me the ELF file off-list to check the patch resolves the
issue of printing corrupted interpreter strings. It does. I am pushing
this patch to master.
Thanks,
Mark
Check phdr->p_filesz and make sure interpreter string is zero terminated
before calling printf.
Reported-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
+2014-02-07 Mark Wielaard <mjw@redhat.com>
+
+ * readelf.c (print_phdr): Check phdr->p_filesz and make sure
+ interpreter string is zero terminated before calling printf.