]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
wintun: use correct length for security attributes
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 17 Sep 2019 01:38:33 +0000 (19:38 -0600)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 17 Sep 2019 01:38:33 +0000 (19:38 -0600)
tun/wintun/namespace_windows.go

index 01fff91c562bee637bd614cb9f74b18e360ef7d8..de781a5f9d3c1d777a8eee3aa0e08b4b7e7100eb 100644 (file)
@@ -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)