Skip to content

Commit

Permalink
check if decode[idx] is callable (capstone-engine#2322)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ced2911 authored Apr 23, 2024
1 parent bf05d69 commit e9284b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/SH/SHDisassembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,7 @@ static bool sh_disassemble(const uint8_t *code, MCInst *MI, uint64_t address,
idx = ((insn >> 8) & 0xf0) | (insn & 0x000f);
}

if (decode[idx]) {
if (idx < ARR_SIZE(decode) && decode[idx]) {
return decode[idx](insn, address, MI, mode, info, detail);
} else {
return MCDisassembler_Fail;
Expand Down

0 comments on commit e9284b6

Please sign in to comment.