mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-30 17:00:26 +00:00
mips: sanity check for input code length of Mips64
This commit is contained in:
parent
d83bf84cba
commit
fbfa06deb7
@ -410,6 +410,14 @@ static DecodeStatus Mips64Disassembler_getInstruction(int mode, MCInst *instr,
|
||||
{
|
||||
uint32_t Insn;
|
||||
|
||||
if (code_len < 4)
|
||||
// not enough data
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
if (instr->flat_insn->detail) {
|
||||
memset(instr->flat_insn->detail, 0, sizeof(cs_detail));
|
||||
}
|
||||
|
||||
DecodeStatus Result = readInstruction32((unsigned char*)code, &Insn, isBigEndian, false);
|
||||
if (Result == MCDisassembler_Fail)
|
||||
return MCDisassembler_Fail;
|
||||
|
Loading…
Reference in New Issue
Block a user