Skip to content

Conversation

@joel-rieke
Copy link
Collaborator

Potential fix for https://github.com/trimble-oss/go-mysql-server/security/code-scanning/253

The best way to fix the issue is to add bounds checks to ensure the float64 value fits within the range of int64 before converting. This can be achieved using constants from the math package (math.MinInt64 and math.MaxInt64). Additionally, the code should return an error or a default value if the bounds are violated.

To implement the fix, we need to modify the t.Convert() method in the yearType struct to include bounds checks for float64 values before converting them to int64. The changes will be applied to the relevant section of the switch statement handling the float64 case.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…etween integer types

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@joel-rieke joel-rieke marked this pull request as ready for review July 15, 2025 17:57
@joel-rieke joel-rieke merged commit a440633 into main Jul 15, 2025
5 checks passed
@joel-rieke joel-rieke deleted the alert-autofix-253 branch July 15, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants