]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix another illegal memory access triggered by corrupt ELF input files.
authorNick Clifton <nickc@redhat.com>
Wed, 5 Feb 2025 16:27:38 +0000 (16:27 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 5 Feb 2025 16:27:38 +0000 (16:27 +0000)
PR 32644

bfd/elflink.c

index bf940942ec3b5d9cc52c510494504f338d54b16f..df6eb250961cb69002f4e8f250e1e92ba70ba30c 100644 (file)
@@ -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.  */