Skip to content

Commit 7f4ecee

Browse files
cpuguy83thaJeztah
authored andcommitted
Fix integer overflow on windows
Signed-off-by: Brian Goff <cpuguy83@gmail.com> (cherry picked from commit bd7c6ca) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 6097883 commit 7f4ecee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/containerd/command/service_windows.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ func initPanicFile(path string) error {
347347
// Update STD_ERROR_HANDLE to point to the panic file so that Go writes to
348348
// it when it panics. Remember the old stderr to restore it before removing
349349
// the panic file.
350-
sh := windows.STD_ERROR_HANDLE
351-
h, err := windows.GetStdHandle(uint32(sh))
350+
sh := uint32(windows.STD_ERROR_HANDLE)
351+
h, err := windows.GetStdHandle(sh)
352352
if err != nil {
353353
return err
354354
}
@@ -372,7 +372,7 @@ func initPanicFile(path string) error {
372372
func removePanicFile() {
373373
if st, err := panicFile.Stat(); err == nil {
374374
if st.Size() == 0 {
375-
sh := windows.STD_ERROR_HANDLE
375+
sh := uint32(windows.STD_ERROR_HANDLE)
376376
setStdHandle.Call(uintptr(sh), uintptr(oldStderr))
377377
panicFile.Close()
378378
os.Remove(panicFile.Name())

0 commit comments

Comments
 (0)