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 code scanning alert no. 13: Incorrect conversion between integer types #44

Closed
wants to merge 1 commit into from

Conversation

cooljeanius
Copy link
Owner

Fixes https://github.com/cooljeanius/gcc/security/code-scanning/13

To fix the problem, we should replace the use of strconv.Atoi with strconv.ParseInt, specifying the bit size to match the target type (uint32). Additionally, we should add bounds checking to ensure the parsed integer fits within the range of uint32.

  • Replace strconv.Atoi with strconv.ParseInt specifying a 32-bit size.
  • Add bounds checking to ensure the parsed value is within the range of uint32.
  • Update the relevant lines in the file libgo/go/debug/pe/section.go.

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

…types

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@cooljeanius
Copy link
Owner Author

breaks build, so, no.

@cooljeanius cooljeanius deleted the autofix/alert-13-3d50ad774d branch September 26, 2024 14:47
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.

1 participant