Skip to content

Commit

Permalink
trial
Browse files Browse the repository at this point in the history
  • Loading branch information
uriziv1 committed Aug 25, 2024
1 parent 35abf50 commit 09655e5
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,13 @@ import (
const MainBasePath = "/"
const CompatibilityBasePath = "/compatibility/"

//go:nosec G115
func safeIntToInt32(val int) int32 {
// Verify no integer overflow conversion int -> int32 (gosec)
if val < math.MinInt32 || val > math.MaxInt32 {
panic("integer overflow")
panic("safeIntToInt32 - integer overflow")
}

// Check if the conversion might lead to overflow
if val == math.MaxInt && math.MaxInt32 < math.MaxInt {
return math.MaxInt32
}

return int32(val)
return int32(val) // int conversion
}

func GetDeployment(namespace string) *appsv1.Deployment {
Expand Down

0 comments on commit 09655e5

Please sign in to comment.