mirror of
https://github.com/capstone-engine/capstone.git
synced 2025-02-10 16:42:54 +00:00
Fix Thumb disassembler memory corruption with IT sequence (issue #385)
This commit is contained in:
parent
76c0c45ec0
commit
1d9615de78
@ -44,6 +44,10 @@
|
||||
|
||||
static bool ITStatus_push_back(ARM_ITStatus *it, char v)
|
||||
{
|
||||
if (it->size >= sizeof(it->ITStates)) {
|
||||
// TODO: consider warning user.
|
||||
it->size = 0;
|
||||
}
|
||||
it->ITStates[it->size] = v;
|
||||
it->size++;
|
||||
|
||||
@ -751,8 +755,7 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
|
||||
// Nested IT blocks are UNPREDICTABLE. Must be checked before we add
|
||||
// the Thumb predicate.
|
||||
if (MCInst_getOpcode(MI) == ARM_t2IT && ITStatus_instrInITBlock(&(ud->ITBlock)))
|
||||
result = MCDisassembler_SoftFail;
|
||||
|
||||
return MCDisassembler_SoftFail;
|
||||
Check(&result, AddThumbPredicate(ud, MI));
|
||||
|
||||
// If we find an IT instruction, we need to parse its condition
|
||||
|
Loading…
x
Reference in New Issue
Block a user