From 0233f35d1fe487bf71cf0055a6cbfbe17c46bbdc Mon Sep 17 00:00:00 2001 From: ghidra1 Date: Mon, 21 Aug 2023 18:19:02 -0400 Subject: [PATCH] GP-3707 corrected array index bug in RISCV_ElfRelocationContext --- .../bin/format/elf/relocation/RISCV_ElfRelocationContext.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationContext.java b/Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationContext.java index a1a453f546..caf8234f41 100644 --- a/Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationContext.java +++ b/Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationContext.java @@ -71,7 +71,7 @@ class RISCV_ElfRelocationContext extends ElfRelocationContext { --relIndex; } // look for hi20 relocation - while (relIndex < relocations.length && relocations[relIndex - 1].getOffset() == symValue) { + while (relIndex < relocations.length && relocations[relIndex].getOffset() == symValue) { int type = relocations[relIndex].getType(); if ((type == RISCV_ElfRelocationConstants.R_RISCV_PCREL_HI20) || (type == RISCV_ElfRelocationConstants.R_RISCV_GOT_HI20)) {