Skip to content

Commit

Permalink
Decoder: change error code for NULL buffer arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
athre0z committed Oct 9, 2022
1 parent 807af68 commit 2a9f9c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -4969,11 +4969,11 @@ ZyanStatus ZydisDecoderDecodeFull(const ZydisDecoder* decoder,
const void* buffer, ZyanUSize length, ZydisDecodedInstruction* instruction,
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT])
{
if (!decoder || !instruction || !operands)
if (!decoder || !instruction || !buffer || !operands)
{
return ZYAN_STATUS_INVALID_ARGUMENT;
}
if (!buffer || !length)
if (!length)
{
return ZYDIS_STATUS_NO_MORE_DATA;
}
Expand All @@ -4995,12 +4995,12 @@ ZyanStatus ZydisDecoderDecodeFull(const ZydisDecoder* decoder,
ZyanStatus ZydisDecoderDecodeInstruction(const ZydisDecoder* decoder, ZydisDecoderContext* context,
const void* buffer, ZyanUSize length, ZydisDecodedInstruction* instruction)
{
if (!decoder || !instruction)
if (!decoder || !instruction || !buffer)
{
return ZYAN_STATUS_INVALID_ARGUMENT;
}

if (!buffer || !length)
if (!length)
{
return ZYDIS_STATUS_NO_MORE_DATA;
}
Expand Down

0 comments on commit 2a9f9c6

Please sign in to comment.