Fixed an issue where instructions with more than 15-bytes did not get rejected correctly

fixes #17
This commit is contained in:
flobernd 2017-09-14 19:05:13 +02:00
parent f230688af4
commit 867b6bc109
1 changed files with 1 additions and 1 deletions

View File

@ -320,7 +320,7 @@ static ZydisStatus ZydisInputNextBytes(ZydisDecoderContext* context,
ZYDIS_ASSERT(instruction);
ZYDIS_ASSERT(value);
if (instruction->length >= ZYDIS_MAX_INSTRUCTION_LENGTH)
if (instruction->length + numberOfBytes > ZYDIS_MAX_INSTRUCTION_LENGTH)
{
return ZYDIS_STATUS_INSTRUCTION_TOO_LONG;
}