Skip to content

Commit

Permalink
int overflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
ale8k committed Aug 21, 2024
1 parent 3223bb1 commit edfa401
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/jimm/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ func (w *Watcher) handleDelta(ctx context.Context, modelIDf func(string) *modelS
var cores int64
machine := d.Entity.(*jujuparams.MachineInfo)
if machine.HardwareCharacteristics != nil && machine.HardwareCharacteristics.CpuCores != nil {
//nolint:gosec // We expect cpu cores to fit into int64.
cores = int64(*machine.HardwareCharacteristics.CpuCores)
}
sCores, ok := state.machines[eid.Id]
Expand Down
1 change: 1 addition & 0 deletions internal/jimmtest/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ func (m *Model) DBObject(c *qt.C, db db.Database) dbmodel.Model {
m.env.Controller(m.Controller)
migrationControllerID := sql.NullInt32{}
if m.MigrationController != "" {
//nolint:gosec // I'd will fit.
migrationControllerID.Int32 = int32(m.env.Controller(m.MigrationController).dbo.ID)
migrationControllerID.Valid = true
}
Expand Down
1 change: 1 addition & 0 deletions internal/openfga/openfga.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ func (o *OFGAClient) removeTuples(ctx context.Context, tuple Tuple) (err error)
for {
// Since we're deleting the returned tuples, it's best to avoid pagination,
// and fresh query for the relations.
//nolint:gosec // The page size will not exceed int32.
tuples, ct, err := o.ReadRelatedObjects(ctx, tuple, int32(pageSize), "")
if err != nil {
return err
Expand Down

0 comments on commit edfa401

Please sign in to comment.