From e851523ebdc0d59d73f9947003b7c3c0dae1e601 Mon Sep 17 00:00:00 2001 From: pzoli Date: Tue, 23 May 2023 12:41:20 +0200 Subject: [PATCH] Fix buffer out of range crash The wintun driver can provide larger packages than the buffer size of the reader part. --- device/queueconstants_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/device/queueconstants_windows.go b/device/queueconstants_windows.go index 1eee32b..e085f3b 100644 --- a/device/queueconstants_windows.go +++ b/device/queueconstants_windows.go @@ -10,6 +10,6 @@ const ( QueueOutboundSize = 1024 QueueInboundSize = 1024 QueueHandshakeSize = 1024 - MaxSegmentSize = 2048 - 32 // largest possible UDP datagram - PreallocatedBuffersPerPool = 0 // Disable and allow for infinite memory growth + MaxSegmentSize = 65535 // Match with WINTUN_MAX_IP_PACKET_SIZE macro definition + PreallocatedBuffersPerPool = 0 // Disable and allow for infinite memory growth )