]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Import a fix from the mainline sources that prevents a potential illegal memory acces...
authorNick Clifton <nickc@redhat.com>
Tue, 11 Feb 2020 15:55:25 +0000 (15:55 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 11 Feb 2020 15:55:25 +0000 (15:55 +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 d695a0e1ae4dff0690fb2bb1790a3e1ef90c75bf..b7bbf9c414bad2e9aea4a718005c0a4851b4e466 100644 (file)
@@ -1,3 +1,12 @@
+2020-02-11  Nick Clifton  <nickc@redhat.com>
+
+       Import from the mainline:
+
+       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-02-11  Nick Clifton  <nickc@redhat.com>
 
        Import from the mainline:
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;
     }