aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2025-01-17 14:41:39 +1030
committerAlan Modra <amodra@gmail.com>2025-01-17 16:07:48 +1030
commit7976c00c183f700e60031c67b3cc49875323c02e (patch)
treea4d69523655e21c957ee66beb4c9ad115b859dc6
parent006ccbe61ad0b61622a0934dd607f37620afc30a (diff)
downloadbinutils-7976c00c183f700e60031c67b3cc49875323c02e.zip
binutils-7976c00c183f700e60031c67b3cc49875323c02e.tar.gz
binutils-7976c00c183f700e60031c67b3cc49875323c02e.tar.bz2
buffer overflow in mmix_elf_relocate_section
* elf64-mmix.c (mmix_elf_relocate_section): Correct size of relocs shuffled by memmove.
-rw-r--r--bfd/elf64-mmix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index c377222..5bb6fee 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -1496,7 +1496,7 @@ mmix_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Shift this reloc to the end of the relocs to maintain
the r_offset sorted reloc order. */
relcpy = *rel;
- memmove (rel, rel + 1, (char *) relend - (char *) rel);
+ memmove (rel, rel + 1, (char *) relend - (char *) (rel + 1));
relend[-1] = relcpy;
/* Back up one reloc, or else we'd skip the next reloc