diff --git a/.github/workflows/lib-codeql.yaml b/.github/workflows/lib-codeql.yaml index fc1423ae4..22d2fa91a 100644 --- a/.github/workflows/lib-codeql.yaml +++ b/.github/workflows/lib-codeql.yaml @@ -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: diff --git a/pkg/fpga/dfl_linux.go b/pkg/fpga/dfl_linux.go index 6f2605c76..4ca793d65 100644 --- a/pkg/fpga/dfl_linux.go +++ b/pkg/fpga/dfl_linux.go @@ -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 } diff --git a/pkg/fpga/intel_fpga_linux.go b/pkg/fpga/intel_fpga_linux.go index 13105a6af..fa45d1a3b 100644 --- a/pkg/fpga/intel_fpga_linux.go +++ b/pkg/fpga/intel_fpga_linux.go @@ -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 }