diff options
author | Ced2911 <ced2911@gmail.com> | 2024-04-23 15:58:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-23 21:58:40 +0800 |
commit | e9284b6b367342bb1c42d7b7af946d61848f0c15 (patch) | |
tree | 8610bdd29acca9321666565f3cb143cbf5435e16 | |
parent | bf05d695ddbcd1241e99aac259d71f681eb8c825 (diff) | |
download | capstone-e9284b6b367342bb1c42d7b7af946d61848f0c15.tar.gz |
check if decode[idx] is callable (#2322)
-rw-r--r-- | arch/SH/SHDisassembler.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/SH/SHDisassembler.c b/arch/SH/SHDisassembler.c index 32d60a95..879a8508 100644 --- a/arch/SH/SHDisassembler.c +++ b/arch/SH/SHDisassembler.c @@ -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; |