diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-06-20 17:03:19 +0200 |
---|---|---|
committer | Simon Rozman <simon@rozman.si> | 2019-06-21 12:20:33 +0200 |
commit | e4831b2011b4da479aaaf0a0d5e48be7f6638ac7 (patch) | |
tree | 1c7826a1c2124c4c19fa15079b105b4cec0d0fac | |
parent | Synchronize accesses to MiniportAdapterHandle (diff) | |
download | wintun-e4831b2011b4da479aaaf0a0d5e48be7f6638ac7.tar.xz wintun-e4831b2011b4da479aaaf0a0d5e48be7f6638ac7.zip |
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>
-rw-r--r-- | wintun.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -685,8 +685,8 @@ static NTSTATUS TunDispatchWrite(_Inout_ TUN_CTX *ctx, _Inout_ IRP *Irp) status = STATUS_INVALID_USER_BUFFER; goto cleanup_nbl_queues; } - ptrdiff_t p_size = TunPacketAlign(sizeof(TUN_PACKET) + p->Size); - if (b_end - b < p_size) { + ULONG p_size = TunPacketAlign(sizeof(TUN_PACKET) + p->Size); + if (b_end - b < (ptrdiff_t)p_size) { status = STATUS_INVALID_USER_BUFFER; goto cleanup_nbl_queues; } |