Fix NdisQueryMdl() NULL-buffer check
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
9514ef37b3
commit
faf810e8cb
3
wintun.c
3
wintun.c
@ -258,8 +258,9 @@ static NTSTATUS TunGetIrpBuffer(_In_ IRP *Irp, _Out_ UCHAR **buffer, _Out_ ULONG
|
|||||||
if (!Irp->MdlAddress)
|
if (!Irp->MdlAddress)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
ULONG size_mdl;
|
ULONG size_mdl;
|
||||||
|
*buffer = NULL;
|
||||||
NdisQueryMdl(Irp->MdlAddress, buffer, &size_mdl, priority);
|
NdisQueryMdl(Irp->MdlAddress, buffer, &size_mdl, priority);
|
||||||
if (!buffer)
|
if (!*buffer)
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
if (size_mdl < *size)
|
if (size_mdl < *size)
|
||||||
*size = size_mdl;
|
*size = size_mdl;
|
||||||
|
Loading…
Reference in New Issue
Block a user