Skip to content

Commit

Permalink
Ensure running inside container
Browse files Browse the repository at this point in the history
  • Loading branch information
blaubaer committed Oct 10, 2024
1 parent 1d5a637 commit b8aff88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/build/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
"math"
"os/user"
"runtime"
"strconv"
Expand Down Expand Up @@ -197,7 +198,7 @@ func (this *base) resolvePr() uint {
return 0
}
n, _ := strconv.ParseUint(strings.TrimSuffix(v, "/merge"), 10, 64)
if n > uint64(^uint(0)) {
if n > uint64(math.MaxUint) {
return 0 // or handle the error appropriately
}
return uint(n)

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types High

Incorrect conversion of an unsigned 64-bit integer from
strconv.ParseUint
to a lower bit size type uint without an upper bound check.
Expand Down

0 comments on commit b8aff88

Please sign in to comment.