Bug 1323760 - object-only code uses string after it has been freed
Summary: object-only code uses string after it has been freed
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: binutils
Version: DTS 4.1 RHEL 6
Hardware: All
OS: All
unspecified
low
Target Milestone: beta1
: 4.1
Assignee: Nick Clifton
QA Contact: Martin Cermak
URL:
Whiteboard:
Depends On: 1323759
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-04 15:44 UTC by Nick Clifton
Modified: 2016-04-06 09:38 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1323759
Environment:
Last Closed: 2016-04-06 09:38:34 UTC
Target Upstream Version:


Attachments (Terms of Use)
Proposed Patch (1.03 KB, patch)
2016-04-04 15:44 UTC, Nick Clifton
no flags Details | Diff

Description Nick Clifton 2016-04-04 15:44:38 UTC
Created attachment 1143381 [details]
Proposed Patch

+++ This bug was initially created as a clone of Bug #1323759 +++

Description of problem:

The function ld/ldlang.c:cmdline_add_object_only_section() assigns the variable
ofilename to the result of bfd_get_filename(), but it does not copy the result.
Thus once bfd_close has been called on the file, ofilename no longer points to
valid memory.  But, it is still used by cmdline_add_object_only_section as an
argument to rename().


Version-Release number of selected component (if applicable):

n/a.

How reproducible:

Run linker testsuite.  Note failures of LTO 5 and LTO 3 tests.

Additional info:

Comment 2 Nick Clifton 2016-04-06 09:38:34 UTC
This BZ has already been fixed by another commit.


Note You need to log in before you can comment on or make changes to this bug.