[PATCH] readelf: Handle NULL phdr in handle_dynamic_symtab
Aaron Merey
amerey@redhat.com
Thu Feb 13 20:35:34 GMT 2025
Hi Mark,
On Mon, Feb 10, 2025 at 1:32 PM Mark Wielaard <mark@klomp.org> wrote:
>
> A corrupt ELF file can have broken program headers, in which case
> gelf_getphdr returns NULL. This could crash handle_dynamic_symtab
> while searching for the PT_DYNAMIC phdr. Fix this by checking whether
> gelf_phdr returns NULL.
>
> * src/readelf.c (handle_dynamic_symtab): Check whether
> gelf_getphdr returns NULL.
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=32655
>
> Signed-off-by: Mark Wielaard <mark@klomp.org>
LGTM.
Aaron
More information about the Elfutils-devel
mailing list