Re: [PATCH] libelf: Only fetch shdr once in elf_compress[_gnu]

2024-11-07 Thread Aaron Merey
Hi Mark, On Wed, Nov 6, 2024 at 2:13 PM Mark Wielaard wrote: > > Some compilers assume the second call to elf[32|64]_getshdr can fail > and produce error: potential null pointer dereference. Just store the > result of the first call and reuse (when not NULL). > >* libelf/elf_compress.c (e

[PATCH] libelf: Only fetch shdr once in elf_compress[_gnu]

2024-11-06 Thread Mark Wielaard
Some compilers assume the second call to elf[32|64]_getshdr can fail and produce error: potential null pointer dereference. Just store the result of the first call and reuse (when not NULL). * libelf/elf_compress.c (elf_compress): Store getshdr result in a shdr union var. * li