From: Nick Clifton Date: Wed, 5 Feb 2025 16:27:38 +0000 (+0000) Subject: Fix another illegal memory access triggered by corrupt ELF input files. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b425859021d17adf62f06fb904797cf8642986ad;p=thirdparty%2Fbinutils-gdb.git Fix another illegal memory access triggered by corrupt ELF input files. PR 32644 --- diff --git a/bfd/elflink.c b/bfd/elflink.c index bf940942ec3..df6eb250961 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -15116,6 +15116,10 @@ bfd_elf_reloc_symbol_deleted_p (bfd_vma offset, void *cookie) } else { + if (r_symndx >= rcookie->locsymcount) + /* This can happen with corrupt input. */ + return false; + /* It's not a relocation against a global symbol, but it could be a relocation against a local symbol for a discarded section. */