Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect conversion between integer types #467

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

tenthirtyam
Copy link
Contributor

Summary

Includes changes to the internal/resources/tanzupackageinstall/spec/cluster_scope.go file to enhance the handling of numeric values in the ConstructSpecForClusterScope function. The most important changes include the addition of a new import and improved handling of large integer values.

Improvements to numeric handling:

Type

  • This is a bug fix.
  • This is an enhancement or feature.
  • This is a code style/formatting update.
  • This is a documentation update.
  • This is a refactoring update.
  • This is a chore update
  • This is something else.
    Please describe:

Breaking Changes?

  • Yes, there are breaking changes.
  • No, there are no breaking changes.

Test and Documentation

  • Tests have been completed.
  • Documentation has been added or updated.

Issue References

https://github.com/vmware/terraform-provider-tanzu-mission-control/security/code-scanning/1

Additional Information

To fix the problem, we need to ensure that the value parsed by strconv.ParseUint does not exceed the maximum value that an int can hold before converting it. We can achieve this by adding a bounds check before the conversion. If the value exceeds the maximum value of an int, we should handle it appropriately, such as by setting a default value or returning an error.

Signed-off-by: Ryan Johnson <[email protected]>
@tenthirtyam tenthirtyam added bug Bug technical-debt Technical Debt labels Dec 3, 2024
@tenthirtyam tenthirtyam added this to the On Deck milestone Dec 3, 2024
@tenthirtyam tenthirtyam self-assigned this Dec 3, 2024
@tenthirtyam tenthirtyam requested a review from a team December 3, 2024 17:26
@github-actions github-actions bot added provider Provider needs-review Needs Review labels Dec 3, 2024
@tenthirtyam tenthirtyam merged commit 13528e5 into main Dec 4, 2024
6 of 8 checks passed
@tenthirtyam tenthirtyam deleted the fix/incorrect-conversion-between-integer-types branch December 4, 2024 16:12
@tenthirtyam tenthirtyam removed the needs-review Needs Review label Dec 6, 2024
Copy link

github-actions bot commented Jan 6, 2025

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug provider Provider technical-debt Technical Debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants