Skip to content

Commit 4eaf6e2

Browse files
author
Peter Goodman
authored
Error out if there are fewer than four bytes to decode. (#510)
* Error out if there are fewer than four bytes to decode. * Update Decode.cpp
1 parent 8b5f739 commit 4eaf6e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Arch/AArch32/Decode.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3460,6 +3460,11 @@ bool AArch32Arch::DecodeInstruction(uint64_t address,
34603460
inst.arch = this;
34613461
inst.category = Instruction::kCategoryInvalid;
34623462
inst.operands.clear();
3463+
3464+
if (4ull > inst_bytes.size()) {
3465+
return false;
3466+
}
3467+
34633468
if (!inst.bytes.empty() && inst.bytes.data() == inst_bytes.data()) {
34643469
inst.bytes.resize(inst_bytes.size());
34653470
} else {

0 commit comments

Comments
 (0)