Chore: make CodeQL happy

This commit is contained in:
gVisor bot 2022-06-01 21:38:05 +08:00
parent bbf0f1af4b
commit cc94b23d13

View file

@ -333,9 +333,9 @@ func match(metadata *C.Metadata) (C.Proxy, C.Rule, error) {
if !processFound && rule.ShouldFindProcess() { if !processFound && rule.ShouldFindProcess() {
processFound = true processFound = true
srcPort, err := strconv.Atoi(metadata.SrcPort) srcPort, err := strconv.ParseUint(metadata.SrcPort, 10, 16)
if err == nil { if err == nil {
path, err := P.FindProcessName(metadata.NetWork.String(), metadata.SrcIP, srcPort) path, err := P.FindProcessName(metadata.NetWork.String(), metadata.SrcIP, int(srcPort))
if err != nil { if err != nil {
log.Debugln("[Process] find process %s: %v", metadata.String(), err) log.Debugln("[Process] find process %s: %v", metadata.String(), err)
} else { } else {