From 27e3da31c31572fde3d6e244a68ea45fb874b038 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 17 Dec 2021 15:41:59 +1030 Subject: 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bfd/elf-bfd.h') diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 91bb1b2..68e830c 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1914,7 +1914,7 @@ struct output_elf_obj_tdata /* Linker information. */ struct bfd_link_info *link_info; - int num_section_syms; + unsigned int num_section_syms; unsigned int shstrtab_section, strtab_section; /* Segment flags for the PT_GNU_STACK segment. */ -- cgit v1.1