Skip to content

Commit

Permalink
Merge pull request #1606 from mythi/PR-2023-057
Browse files Browse the repository at this point in the history
codeql fixes
  • Loading branch information
tkatila authored Dec 4, 2023
2 parents 53372ed + 8f28a7b commit 1971717
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/lib-codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: 'go'

- uses: actions/setup-go@v4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion pkg/fpga/dfl_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (f *DflFME) GetPortsNum() int {
}

n, err := strconv.ParseUint(f.PortsNum, 10, 32)
if err != nil {
if err != nil || n >= math.MaxInt {
return -1
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/fpga/intel_fpga_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (f *IntelFpgaFME) GetPortsNum() int {
}

n, err := strconv.ParseUint(f.PortsNum, 10, 32)
if err != nil {
if err != nil || n >= math.MaxInt {
return -1
}

Expand Down

0 comments on commit 1971717

Please sign in to comment.