Re: [PATCH] readelf: Handle NULL phdr in handle_dynamic_symtab

2025-02-13 Thread Aaron Merey
Hi Mark, On Mon, Feb 10, 2025 at 1:32 PM Mark Wielaard 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.

[PATCH] readelf: Handle NULL phdr in handle_dynamic_symtab

2025-02-10 Thread Mark Wielaard
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