aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-03-19 14:40:00 +0000
committerNick Clifton <nickc@redhat.com>2020-03-19 14:40:00 +0000
commit6a541707f341275fa5081ec36cc6f2551042c21e (patch)
tree2e0d03237e46b59dc2c9f313662341754a706d2a /bfd/elf.c
parentfcc7376e0a4c3a68ef0b9d12fcc3733416b1cc8c (diff)
downloadgdb-6a541707f341275fa5081ec36cc6f2551042c21e.zip
gdb-6a541707f341275fa5081ec36cc6f2551042c21e.tar.gz
gdb-6a541707f341275fa5081ec36cc6f2551042c21e.tar.bz2
Fix assertion failure in the BFD library when called to parse a file containing corrupt ELF group information.
PR 25699 * elf.c (bfd_elf_set_group_contents): Replace assertion with an error return.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index d182387..6cbc389 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3533,8 +3533,13 @@ bfd_elf_set_group_contents (bfd *abfd, asection *sec, void *failedptrarg)
if (symindx == 0)
{
/* If called from the assembler, swap_out_syms will have set up
- elf_section_syms. */
- BFD_ASSERT (elf_section_syms (abfd) != NULL);
+ elf_section_syms.
+ PR 25699: A corrupt input file could contain bogus group info. */
+ if (elf_section_syms (abfd) == NULL)
+ {
+ *failedptr = TRUE;
+ return;
+ }
symindx = elf_section_syms (abfd)[sec->index]->udata.i;
}
elf_section_data (sec)->this_hdr.sh_info = symindx;