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 conversion between integer types #872

Merged
merged 2 commits into from
Nov 8, 2024
Merged

Fix conversion between integer types #872

merged 2 commits into from
Nov 8, 2024

Conversation

pschork
Copy link
Contributor

@pschork pschork commented Nov 7, 2024

Fixes https://github.com/Layr-Labs/eigenda/security/code-scanning/16

To fix the problem, we should replace the use of strconv.Atoi with strconv.ParseInt, specifying the bit size to match the target type (int32). Additionally, we should add bounds checking to ensure that the parsed value fits within the range of int32. This will prevent any unexpected values due to overflow.

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>
@pschork pschork changed the title Fix code scanning alert no. 16: Incorrect conversion between integer types Incorrect conversion between integer types Nov 7, 2024
@pschork pschork changed the title Incorrect conversion between integer types Fix conversion between integer types Nov 7, 2024
@pschork pschork marked this pull request as ready for review November 7, 2024 19:46
@pschork pschork requested review from anupsv and jianoaix November 7, 2024 19:47
@pschork pschork merged commit bab71e8 into master Nov 8, 2024
9 checks passed
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