From 355eb491ad419b3e7d561172d3ba1536e969d463 Mon Sep 17 00:00:00 2001 From: Kr328 Date: Thu, 15 Jun 2023 17:51:55 +0800 Subject: [PATCH] Fix: windows process panic (#2791) --- component/process/process_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/component/process/process_windows.go b/component/process/process_windows.go index 9eacfbc..6ae61a3 100644 --- a/component/process/process_windows.go +++ b/component/process/process_windows.go @@ -46,7 +46,7 @@ func findPidByConnectionEndpoint(family uint32, protocol uint32, from netip.Addr buf := pool.Get(8) defer pool.Put(buf) - bufSize := len(buf) + bufSize := uint32(len(buf)) loop: for { @@ -82,7 +82,7 @@ loop: break loop case uintptr(windows.ERROR_INSUFFICIENT_BUFFER): pool.Put(buf) - buf = pool.Get(bufSize) + buf = pool.Get(int(bufSize)) continue loop default: