From 867b6bc1094c29a7adef993a8964cf2421a8cdaa Mon Sep 17 00:00:00 2001 From: flobernd Date: Thu, 14 Sep 2017 19:05:13 +0200 Subject: [PATCH] Fixed an issue where instructions with more than 15-bytes did not get rejected correctly fixes #17 --- src/Decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }