Fix: windows process panic (#2791)

This commit is contained in:
Kr328 2023-06-15 17:51:55 +08:00 committed by GitHub
parent 18c666a1ab
commit 355eb491ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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: