diff options
author | Alan Modra <amodra@gmail.com> | 2021-10-06 18:28:47 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-10-07 14:59:53 +1030 |
commit | a281816c8aeb12619d34eec8959a43dfa5c6b4ec (patch) | |
tree | f1feb93885106f24c97137dac53734b50bd10cb4 | |
parent | 163d8077435419ae9ad7fb55503a8005067362a0 (diff) | |
download | gdb-a281816c8aeb12619d34eec8959a43dfa5c6b4ec.zip gdb-a281816c8aeb12619d34eec8959a43dfa5c6b4ec.tar.gz gdb-a281816c8aeb12619d34eec8959a43dfa5c6b4ec.tar.bz2 |
PR28422, build_id use-after-free
This fixes a bug in commit 5d9bbb73c1df. All fields preserved from a
bfd in struct bfd_preserve need to be cleared in bfd_reinit.
PR 28422
* format.c (bfd_reinit): Clear build_id.
(cherry picked from commit 6d661cdc5be46e890ed9255e749806f46a88e26c)
-rw-r--r-- | bfd/format.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bfd/format.c b/bfd/format.c index 43bb341..54b63c2 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -151,6 +151,7 @@ bfd_reinit (bfd *abfd, unsigned int section_id, bfd_cleanup cleanup) abfd->tdata.any = NULL; abfd->arch_info = &bfd_default_arch_struct; abfd->flags &= BFD_FLAGS_SAVED; + abfd->build_id = NULL; bfd_section_list_clear (abfd); } |