Use ULONG instead of ptrdiff_t for length measurement
Even though we're comparing this with a ptrdiff_t in one place and adding it to a void* in another place, it's still a length and as such should be a size_t, which I guess in our weird universe here is a ULONG. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
dea5bfa2d2
commit
e4831b2011
4
wintun.c
4
wintun.c
@ -685,8 +685,8 @@ static NTSTATUS TunDispatchWrite(_Inout_ TUN_CTX *ctx, _Inout_ IRP *Irp)
|
|||||||
status = STATUS_INVALID_USER_BUFFER;
|
status = STATUS_INVALID_USER_BUFFER;
|
||||||
goto cleanup_nbl_queues;
|
goto cleanup_nbl_queues;
|
||||||
}
|
}
|
||||||
ptrdiff_t p_size = TunPacketAlign(sizeof(TUN_PACKET) + p->Size);
|
ULONG p_size = TunPacketAlign(sizeof(TUN_PACKET) + p->Size);
|
||||||
if (b_end - b < p_size) {
|
if (b_end - b < (ptrdiff_t)p_size) {
|
||||||
status = STATUS_INVALID_USER_BUFFER;
|
status = STATUS_INVALID_USER_BUFFER;
|
||||||
goto cleanup_nbl_queues;
|
goto cleanup_nbl_queues;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user