Skip to content

Commit

Permalink
Fix OOB read
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Sep 10, 2024
1 parent b850edf commit bf7510c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ void map_implicit_reads(MCInst *MI, const insn_map *imap)
return;
}
detail->regs_read[detail->regs_read_count++] = reg;
if (i < MAX_IMPL_R_REGS) {
if (i + 1 < MAX_IMPL_R_REGS) {
// Select next one
reg = imap[Opcode].regs_use[++i];
}
}
Expand All @@ -177,7 +178,8 @@ void map_implicit_writes(MCInst *MI, const insn_map *imap)
return;
}
detail->regs_write[detail->regs_write_count++] = reg;
if (i < MAX_IMPL_W_REGS) {
if (i + 1 < MAX_IMPL_W_REGS) {
// Select next one
reg = imap[Opcode].regs_mod[++i];
}
}
Expand Down

0 comments on commit bf7510c

Please sign in to comment.