https://sourceware.org/bugzilla/show_bug.cgi?id=33491

Aaron Merey <amerey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Aaron Merey <amerey at redhat dot com> ---
Fixed in the following commit:

commit 42823ca610647db13ff6b65603ea00333a1d2634
Author: Aaron Merey <[email protected]>
Date:   Thu Oct 23 22:25:25 2025 -0400

    elf_getarhdr.c: Return correct header for archive within an archive

    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]>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to