Hi Aaron, On Thu, 2025-10-23 at 22:25 -0400, Aaron Merey wrote: > If elf_getarhdr is called on a descriptor that refers to an archive > which is itself a member of another archive, it may return the Elf_Arhdr > of the current member (i.e., the member selected by elf_next or elf_rand) > of the inner archive instead of Elf_Arhdr of the inner archive itself. > > This also causes a memory leak: elf_end only attempts to free > Elf_Arhdr fields ar_name and ar_rawname for descriptors that are not > ELF_K_AR. > > To fix this, replace the state.elf[32|64] field elf_ar_hdr with new > struct Elf field elf_ar_hdr. This field stores the Elf_Arhdr for all > descriptors of archive members, including those with kind ELF_K_AR. > > Also rename the state.ar field elf_ar_hdr to cur_ar_hdr to clarify that > this is the header of an archive's current member. > > Signed-off-by: Aaron Merey <[email protected]> > --- > > v3 changes: Use headings and indentation levels to improve readability > of ar-extract-ar output. Also replace one testrun with testrun_compare.
Nice! Really like the indent. Missed the testrun_compare thing. Thanks. Only other change I see is adding the testcase exe to .gitignore. Looks good to me. Cheers, Mark
