aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2025-02-05 16:27:38 +0000
committerNick Clifton <nickc@redhat.com>2025-02-05 16:27:38 +0000
commitb425859021d17adf62f06fb904797cf8642986ad (patch)
tree33fbd313bd947549a3beb75014355bb3ede4013c
parent931494c9a89558acb36a03a340c01726545eef24 (diff)
downloadbinutils-master.zip
binutils-master.tar.gz
binutils-master.tar.bz2
Fix another illegal memory access triggered by corrupt ELF input files.HEADmaster
PR 32644
-rw-r--r--bfd/elflink.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index bf94094..df6eb25 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. */