Fix an illegal call to free() when copying a PE format file.
authorNick Clifton <nickc@redhat.com>
Fri, 24 Jan 2020 13:19:48 +0000 (13:19 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 24 Jan 2020 13:19:48 +0000 (13:19 +0000)
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.

bfd/ChangeLog
bfd/coffgen.c

index 108276ad6abcf022d556a93f0dd4b674c71feed2..5d8d2cdb9eb161b98f14d02d4fcbe767ab730f49 100644 (file)
@@ -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.
index 2bfcf1a6b14a7ee6b3dd6c20905adc3adcb4b0fe..3ddd2d89a83a5a9bb8f3a0a479682d72869be760 100644 (file)
@@ -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;
     }
This page took 0.026054 seconds and 4 git commands to generate.