summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-09-16 19:38:33 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2019-09-16 19:38:33 -0600
commit70f6c42556afad75fa5c9734fe02cd8d2679ed0b (patch)
treed1ae2eb3b38f13360a16e7ce76c35dd350245896
parentbb0b2514c0533edb3c4670cc01bdec735c8e2704 (diff)
wintun: use correct length for security attributes
-rw-r--r--tun/wintun/namespace_windows.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/tun/wintun/namespace_windows.go b/tun/wintun/namespace_windows.go
index 01fff91..de781a5 100644
--- a/tun/wintun/namespace_windows.go
+++ b/tun/wintun/namespace_windows.go
@@ -37,7 +37,7 @@ func initializeNamespace() error {
return fmt.Errorf("SddlToSecurityDescriptor failed: %v", err)
}
wintunObjectSecurityAttributes = &windows.SecurityAttributes{
- Length: uint32(len(sd)),
+ Length: uint32(unsafe.Sizeof(windows.SecurityAttributes{})),
SecurityDescriptor: uintptr(unsafe.Pointer(&sd[0])),
}
sid, err := windows.CreateWellKnownSid(windows.WinLocalSystemSid)