Skip to content

Commit 2a9f9c6

Browse files
committed
Decoder: change error code for NULL buffer arguments
1 parent 807af68 commit 2a9f9c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Decoder.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -4969,11 +4969,11 @@ ZyanStatus ZydisDecoderDecodeFull(const ZydisDecoder* decoder,
49694969
const void* buffer, ZyanUSize length, ZydisDecodedInstruction* instruction,
49704970
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT])
49714971
{
4972-
if (!decoder || !instruction || !operands)
4972+
if (!decoder || !instruction || !buffer || !operands)
49734973
{
49744974
return ZYAN_STATUS_INVALID_ARGUMENT;
49754975
}
4976-
if (!buffer || !length)
4976+
if (!length)
49774977
{
49784978
return ZYDIS_STATUS_NO_MORE_DATA;
49794979
}
@@ -4995,12 +4995,12 @@ ZyanStatus ZydisDecoderDecodeFull(const ZydisDecoder* decoder,
49954995
ZyanStatus ZydisDecoderDecodeInstruction(const ZydisDecoder* decoder, ZydisDecoderContext* context,
49964996
const void* buffer, ZyanUSize length, ZydisDecodedInstruction* instruction)
49974997
{
4998-
if (!decoder || !instruction)
4998+
if (!decoder || !instruction || !buffer)
49994999
{
50005000
return ZYAN_STATUS_INVALID_ARGUMENT;
50015001
}
50025002

5003-
if (!buffer || !length)
5003+
if (!length)
50045004
{
50055005
return ZYDIS_STATUS_NO_MORE_DATA;
50065006
}

0 commit comments

Comments
 (0)