Skip to content

Commit

Permalink
fix: work around codeql issue 14733/9295
Browse files Browse the repository at this point in the history
Signed-off-by: thediveo <[email protected]>
  • Loading branch information
thediveo committed Nov 9, 2023
1 parent 90ce923 commit 167d39a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions network/netns_tuntap.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ func discoverProcessors(allprocs model.ProcessTable) []tuntapProcessor {
}
}

fd, err := strconv.ParseUint(fdInfoEntry.Name(), 10, strconv.IntSize-1)
if err != nil {
// Work around bug(s) #14733/#9295 in CodeQL scanning which
// currently block correct parsing using ParseUint(...,
// strconv.IntSize-1) and then casting to int.
fd, err := strconv.ParseInt(fdInfoEntry.Name(), 10, strconv.IntSize)
if err != nil || fd < 0 {
continue
}
taptunFd, err := unix.PidfdGetfd(pidfd, int(fd), 0)
Expand Down

0 comments on commit 167d39a

Please sign in to comment.