bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/14567] New: bfd_openr_next_archived_file is incompatible w


From: arseny.kapoulkine at gmail dot com
Subject: [Bug binutils/14567] New: bfd_openr_next_archived_file is incompatible with bfd_openr_iovec
Date: Mon, 10 Sep 2012 04:00:20 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=14567

             Bug #: 14567
           Summary: bfd_openr_next_archived_file is incompatible with
                    bfd_openr_iovec
           Product: binutils
           Version: 2.22
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


Attempting to open an archive file using bfd_openr_iovec and to subsequently
analyze the first archive member as follows:

bfd* parent = bfd_openr_iovec(path, 0, iovecOpen, &p, iovecRead, iovecClose,
iovecStat);

if (bfd_check_format(parent, bfd_archive))
{
        bfd* abfd = bfd_openr_next_archived_file(parent, NULL);
        if (!abfd) return 0;

        bfd_check_format(abfd, bfd_object);
...
}

results in a crash in opncls_bseek, that occurs because iostream member of the
child archive is NULL. _bfd_new_bfd_contained_in does not copy the iostream
member from the parent; adding the relevant assignment to this function fixes
the crash:

*** opncls.c    2012-09-09 20:59:30.489801700 -0700
--- opnclsnew.c 2012-09-09 20:59:16.483000600 -0700
***************
*** 119,124 ****
--- 119,125 ----
      return NULL;
    nbfd->xvec = obfd->xvec;
    nbfd->iovec = obfd->iovec;
+   nbfd->iostream = obfd->iostream;
    nbfd->my_archive = obfd;
    nbfd->direction = read_direction;
    nbfd->target_defaulted = obfd->target_defaulted;

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]