asan: NULL dereference in bfd_elf_set_group_contents
authorAlan Modra <amodra@gmail.com>
Fri, 17 Dec 2021 05:11:59 +0000 (15:41 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 17 Dec 2021 06:24:56 +0000 (16:54 +1030)
commit27e3da31c31572fde3d6e244a68ea45fb874b038
treec1da58b31e89c4c76632b537879882f47f010e56
parent7ebf6ed02bde3a488bb588316e47b4df68796076
asan: NULL dereference in bfd_elf_set_group_contents

* elf-bfd.h (struct output_elf_obj_tdata): Make num_section_syms
unsigned.
* elf.c (bfd_elf_set_group_contents): Bounds check sec->index
and check that entry in elf_section_syms for sec is non-NULL.
(_bfd_elf_symbol_from_bfd_symbol): Adjust.
bfd/elf-bfd.h
bfd/elf.c