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 7, 2024
1 parent ddfb724 commit d49183a
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 d49183a

Please sign in to comment.