]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
ppc _bfd_clear_contents
authorAlan Modra <amodra@gmail.com>
Tue, 29 Jul 2025 01:16:04 +0000 (10:46 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 29 Jul 2025 12:58:10 +0000 (22:28 +0930)
commit0b23ce71150e80cb09ae2ea791001957b8b48269
tree7808b710999a780094c4f06e84ad0519a2bd8bd5
parent8fd6a9c70b4b67541dbafba64d0e215eada05ff1
ppc _bfd_clear_contents

ppc32 isn't susceptible to the PR33223 segfault, but could hit a
_bfd_clear_contents segfault with a carefully crafted invalid object.

* elf32-ppc.c (ARRAY_SIZE): Define.
(ppc_elf_howto_init): Use ARRAY_SIZE.
(ppc_elf_reloc_name_lookup): Likewise.
(ppc_elf_info_to_howto): Likewise, and consolidate error
handling.
(ppc_elf_check_relocs): Guard against segfaults caused by a NULL
howto passed to _bfd_clear_contents.  Use ARRAY_SIZE.
bfd/elf32-ppc.c