aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/elevate/privileges.go
diff options
context:
space:
mode:
Diffstat (limited to 'elevate/privileges.go')
-rw-r--r--elevate/privileges.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/elevate/privileges.go b/elevate/privileges.go
index 5c4cd69f..3d51640f 100644
--- a/elevate/privileges.go
+++ b/elevate/privileges.go
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: MIT
*
- * Copyright (C) 2019-2021 WireGuard LLC. All Rights Reserved.
+ * Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
*/
package elevate
@@ -44,7 +44,7 @@ func DropAllPrivileges(retainDriverLoading bool) error {
}
tokenPrivileges := (*windows.Tokenprivileges)(unsafe.Pointer(&buffer[0]))
for i := uint32(0); i < tokenPrivileges.PrivilegeCount; i++ {
- item := (*windows.LUIDAndAttributes)(unsafe.Pointer(uintptr(unsafe.Pointer(&tokenPrivileges.Privileges[0])) + unsafe.Sizeof(tokenPrivileges.Privileges[0])*uintptr(i)))
+ item := (*windows.LUIDAndAttributes)(unsafe.Add(unsafe.Pointer(&tokenPrivileges.Privileges[0]), unsafe.Sizeof(tokenPrivileges.Privileges[0])*uintptr(i)))
if retainDriverLoading && item.Luid == luid {
continue
}