diff options
author | Alan Modra <amodra@gmail.com> | 2024-04-11 09:25:13 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2024-04-11 09:32:10 +0930 |
commit | ea3002bc4d2a3c8ad284041f8a7dd08472c3f5fa (patch) | |
tree | bf89ba24380ad55ef8b862d5dd193cc201c7aa4e /bfd | |
parent | f8e9374ea8c6e85012c377a2780ba2fc3c26f208 (diff) | |
download | gdb-ea3002bc4d2a3c8ad284041f8a7dd08472c3f5fa.zip gdb-ea3002bc4d2a3c8ad284041f8a7dd08472c3f5fa.tar.gz gdb-ea3002bc4d2a3c8ad284041f8a7dd08472c3f5fa.tar.bz2 |
Segfault in _bfd_delete_bfd with USE_MMAP
Any of the calls to _bfd_delete_bfd in bfd_fopen will hit this.
* opncls.c (_bfd_delete_bfd): Check for non-NULL xvec before
accessing flavour.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/opncls.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/opncls.c b/bfd/opncls.c index 2f8a3a6..bc76696 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -164,7 +164,8 @@ static void _bfd_delete_bfd (bfd *abfd) { #ifdef USE_MMAP - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) + if (abfd->xvec + && abfd->xvec->flavour == bfd_target_elf_flavour) { asection *sec; for (sec = abfd->sections; sec != NULL; sec = sec->next) |