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. 12: Comparison of narrow type with wide type in loop condition #4

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

Wbaker7702
Copy link
Owner

Fixes https://github.com/Wbaker7702/bitcoin/security/code-scanning/12

To fix the problem, we need to ensure that the type of i is at least as wide as the type of fileSize. Since fileSize is of type size_t, we should change the type of i to size_t as well. This will ensure that the comparison is between variables of the same type, preventing any potential issues related to type width.

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

…ype in loop condition

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

stackblitz bot commented Dec 4, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@Wbaker7702 Wbaker7702 marked this pull request as ready for review December 4, 2024 18:04
@Wbaker7702 Wbaker7702 merged commit 6df01a6 into master Dec 4, 2024
2 of 9 checks passed
@Wbaker7702 Wbaker7702 deleted the Wbaker7702/patch-753 branch December 4, 2024 18:04
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