diff --git a/listener/tun/dev/wintun/session_windows.go b/listener/tun/dev/wintun/session_windows.go index f023baf7..11081158 100644 --- a/listener/tun/dev/wintun/session_windows.go +++ b/listener/tun/dev/wintun/session_windows.go @@ -86,5 +86,7 @@ func (session Session) AllocateSendPacket(packetSize int) (packet []byte, err er } func (session Session) SendPacket(packet []byte) { - syscall.Syscall(procWintunSendPacket.Addr(), 2, session.handle, uintptr(unsafe.Pointer(&packet[0])), 0) + if packet != nil && len(packet) > 0 { + syscall.Syscall(procWintunSendPacket.Addr(), 2, session.handle, uintptr(unsafe.Pointer(&packet[0])), 0) + } }