Fix: codeql alerts

This commit is contained in:
Dreamacro
2021-11-08 00:31:08 +08:00
parent 1a7830f18e
commit d40e5e4fe6
6 changed files with 9 additions and 9 deletions

View File

@ -62,7 +62,7 @@ func bindIfaceToDialer(ifaceName string, dialer *net.Dialer, network string, des
if dialer.LocalAddr != nil {
_, port, err := net.SplitHostPort(dialer.LocalAddr.String())
if err == nil {
local, _ = strconv.Atoi(port)
local, _ = strconv.ParseInt(port, 10, 16)
}
}
@ -82,7 +82,7 @@ func bindIfaceToListenConfig(ifaceName string, _ *net.ListenConfig, network, add
port = "0"
}
local, _ := strconv.Atoi(port)
local, _ := strconv.ParseInt(port, 10, 16)
addr, err := lookupLocalAddr(ifaceName, network, nil, local)
if err != nil {