From bd7c6ca6fa95295c20d531001fe4758bd4560d3a Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Mon, 28 Sep 2020 18:38:57 +0000 Subject: [PATCH] Fix integer overflow on windows Signed-off-by: Brian Goff --- cmd/containerd/command/service_windows.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/containerd/command/service_windows.go b/cmd/containerd/command/service_windows.go index 253127ad3..34f3d71ea 100644 --- a/cmd/containerd/command/service_windows.go +++ b/cmd/containerd/command/service_windows.go @@ -347,8 +347,8 @@ func initPanicFile(path string) error { // Update STD_ERROR_HANDLE to point to the panic file so that Go writes to // it when it panics. Remember the old stderr to restore it before removing // the panic file. - sh := windows.STD_ERROR_HANDLE - h, err := windows.GetStdHandle(uint32(sh)) + sh := uint32(windows.STD_ERROR_HANDLE) + h, err := windows.GetStdHandle(sh) if err != nil { return err } @@ -372,7 +372,7 @@ func initPanicFile(path string) error { func removePanicFile() { if st, err := panicFile.Stat(); err == nil { if st.Size() == 0 { - sh := windows.STD_ERROR_HANDLE + sh := uint32(windows.STD_ERROR_HANDLE) setStdHandle.Call(uintptr(sh), uintptr(oldStderr)) panicFile.Close() os.Remove(panicFile.Name())