Fixed error codes inside `ZydisDecoderDecodeFull`
Fixes Fixes Fixes Fixes
@@ -4968,12 +4968,17 @@ ZyanStatus ZydisDecoderDecodeFull(const ZydisDecoder* decoder,
const void* buffer, ZyanUSize length, ZydisDecodedInstruction* instruction,
ZydisDecodedOperand* operands, ZyanU8 operand_count, ZydisDecodingFlags flags)
{
- if (!decoder || !buffer || !length || !instruction || (operand_count && !operands) ||
+ if (!decoder || !instruction || (operand_count && !operands) ||
(operand_count > ZYDIS_MAX_OPERAND_COUNT))
{
return ZYAN_STATUS_INVALID_ARGUMENT;
}
+ if (!buffer || !length)
+ {
+ return ZYDIS_STATUS_NO_MORE_DATA;
+ }
+
if (decoder->decoder_mode[ZYDIS_DECODER_MODE_MINIMAL])
{
return ZYAN_STATUS_MISSING_DEPENDENCY; // TODO: Introduce better status code
