Skip to content

Commit 63f9ef2

Browse files
authored
chore: fix minor int coercion codeql vulnerability (#7024)
1 parent c18ed61 commit 63f9ef2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cli/agent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ func urlPort(u string) (int, error) {
336336
return -1, xerrors.Errorf("invalid url %q: %w", u, err)
337337
}
338338
if parsed.Port() != "" {
339-
port, err := strconv.ParseInt(parsed.Port(), 10, 64)
340-
if err == nil && port > 0 {
339+
port, err := strconv.ParseUint(parsed.Port(), 10, 16)
340+
if err == nil && port > 0 && port < 1<<16 {
341341
return int(port), nil
342342
}
343343
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy