Skip to content

Commit

Permalink
added oobfix in capstone
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarofe committed Jun 29, 2016
1 parent d681128 commit 3843454
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions shlr/capstone-patches/oobfix-X86_insn_reg_intel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/arch/X86/X86Mapping.c b/arch/X86/X86Mapping.c
index f7d35d2..16450d1 100644
--- a/arch/X86/X86Mapping.c
+++ b/arch/X86/X86Mapping.c
@@ -2780,7 +2780,7 @@ x86_reg X86_insn_reg_intel(unsigned int id, enum cs_ac_type *access)
intel_regs_sorted = true;
}

- while (first <= last) {
+ while (first <= last && mid < ARR_SIZE(insn_regs_intel)) {
if (insn_regs_intel_sorted[mid].insn < id) {
first = mid + 1;
} else if (insn_regs_intel_sorted[mid].insn == id) {

0 comments on commit 3843454

Please # to comment.