Merge pull request #923 from disconnect3d/patch-2

net_linux.go: decode port as uint16 instead of int64
This commit is contained in:
Lomanic 2020-08-30 18:43:20 +02:00 committed by GitHub
commit c4663018cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -696,7 +696,7 @@ func decodeAddress(family uint32, src string) (Addr, error) {
return Addr{}, fmt.Errorf("does not contain port, %s", src)
}
addr := t[0]
port, err := strconv.ParseInt("0x"+t[1], 0, 64)
port, err := strconv.ParseUint(t[1], 16, 16)
if err != nil {
return Addr{}, fmt.Errorf("invalid port, %s", src)
}