lint: Clean up golangci-lint v1.60 complaints
This cleans up the linting results by adding checks for integer underflow/overflow in several places, suppressing the error in places where it has been checked, or fixing the types when possible.
This commit is contained in:
parent
2dad1a965e
commit
0256e09031
11 changed files with 47 additions and 12 deletions
|
|
@ -464,7 +464,13 @@ func (h *apiHandlers) getJobIDComposeStatus(jobId uuid.UUID) (ComposeStatus, err
|
|||
ImageStatuses: &buildJobStatuses,
|
||||
KojiStatus: &KojiStatus{},
|
||||
}
|
||||
/* #nosec G115 */
|
||||
buildID := int(initResult.BuildID)
|
||||
// Make sure signed integer conversion didn't underflow
|
||||
if buildID < 0 {
|
||||
err := fmt.Errorf("BuildID integer underflow: %d", initResult.BuildID)
|
||||
return ComposeStatus{}, HTTPErrorWithInternal(ErrorMalformedOSBuildJobResult, err)
|
||||
}
|
||||
if buildID != 0 {
|
||||
response.KojiStatus.BuildId = &buildID
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue