Skip to content

Commit

Permalink
fix: Potential int64 overflow (#442)
Browse files Browse the repository at this point in the history
#### Summary

Detected via GitHub code scanning, there's a potential overflow in our code
  • Loading branch information
erezrokah authored Dec 3, 2024
1 parent 486994d commit 36dbfae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions managedplugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,11 @@ func (c *Client) oldDiscovery(ctx context.Context) ([]int, error) {
versions := make([]int, len(versionsRes.Versions))
for i, vStr := range versionsRes.Versions {
vStr = strings.TrimPrefix(vStr, "v")
v, err := strconv.ParseInt(vStr, 10, 64)
v, err := strconv.Atoi(vStr)
if err != nil {
return nil, fmt.Errorf("failed to parse version %s: %w", vStr, err)
}
versions[i] = int(v)
versions[i] = v
}
return versions, nil
}
Expand Down

0 comments on commit 36dbfae

Please sign in to comment.