Skip to content

Commit 1926e8e

Browse files
author
Christian Roessner
committed
Fix: Fix port parsing by using strconv.ParseUint
Changed the port parsing method from strconv.Atoi to strconv.ParseUint. This ensures that port numbers are correctly interpreted as unsigned integers, preventing potential issues with negative values. Signed-off-by: Christian Roessner <[email protected]>
1 parent bb2aaec commit 1926e8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/lualib/connmgr/netstats.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func (m *ConnectionManager) UpdateCounts() {
244244
continue
245245
}
246246

247-
port, err := strconv.Atoi(portStr)
247+
port, err := strconv.ParseUint(portStr, 10, 32)
248248
if err != nil {
249249
logError(fmt.Sprintf("Invalid port number for destination '%s'", target), err)
250250

0 commit comments

Comments
 (0)