Chore: make CodeQL happy

This commit is contained in:
Dreamacro 2022-06-01 21:38:05 +08:00
parent c1285adbf8
commit 3360839fe3
1 changed files with 2 additions and 2 deletions

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 {