From 9c3c15a7ff88c8ff670f534a9575fe54811ef8c2 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 16 Sep 2019 19:38:05 -0600 Subject: updater: use correct length for security attributes Signed-off-by: Jason A. Donenfeld --- updater/msirunner_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'updater') diff --git a/updater/msirunner_windows.go b/updater/msirunner_windows.go index 62ec1cdf..6b8ae476 100644 --- a/updater/msirunner_windows.go +++ b/updater/msirunner_windows.go @@ -66,7 +66,7 @@ func msiTempFile() (*os.File, error) { return nil, err } sa := &windows.SecurityAttributes{ - Length: uint32(len(sd)), + Length: uint32(unsafe.Sizeof(windows.SecurityAttributes{})), SecurityDescriptor: uintptr(unsafe.Pointer(&sd[0])), } // TODO: os.TempDir() returns C:\windows\temp when calling from this context. Supposedly this is mostly secure -- cgit v1.2.3-59-g8ed1b