diff options
author | Nick Clifton <nickc@redhat.com> | 2020-01-24 13:19:48 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-01-24 13:19:48 +0000 |
commit | caa31cfad6c16ffbd5c396f74273fc9e413906f0 (patch) | |
tree | 613e2d3d1b4136fb1e99d145d7f3575159e7f361 /bfd | |
parent | 42cd72aa0279520384327a1f6d0ebd2eb2200645 (diff) | |
download | fsf-binutils-gdb-caa31cfad6c16ffbd5c396f74273fc9e413906f0.zip fsf-binutils-gdb-caa31cfad6c16ffbd5c396f74273fc9e413906f0.tar.gz fsf-binutils-gdb-caa31cfad6c16ffbd5c396f74273fc9e413906f0.tar.bz2 |
Fix an illegal call to free() when copying a PE format file.
PR 25447
* coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
syms and keep strings flags as these may have been set in order to
prevent a bogus call to free.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/coffgen.c | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 108276a..5d8d2cd 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2020-01-24 Nick Clifton <nickc@redhat.com> + + PR 25447 + * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep + syms and keep strings flags as these may have been set in order to + prevent a bogus call to free. + 2020-01-23 Nick Clifton <nickc@redhat.com> * po/fr.po: Updated French translation. diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 2bfcf1a..3ddd2d8 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -3175,8 +3175,10 @@ _bfd_coff_close_and_cleanup (bfd *abfd) && bfd_family_coff (abfd) && coff_data (abfd) != NULL) { - obj_coff_keep_syms (abfd) = FALSE; - obj_coff_keep_strings (abfd) = FALSE; + /* PR 25447: + Do not clear the keep_syms and keep_strings flags. + These may have been set by pe_ILF_build_a_bfd() indicating + that the syms and strings pointers are not to be freed. */ if (!_bfd_coff_free_symbols (abfd)) return FALSE; } |