diff --git a/src/Decoder.c b/src/Decoder.c index 8de13f9..64b9c8e 100644 --- a/src/Decoder.c +++ b/src/Decoder.c @@ -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; }