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 comparison using narrow types in loop condition #2360

Merged
merged 1 commit into from
May 17, 2024

Conversation

trufae
Copy link
Contributor

@trufae trufae commented May 16, 2024

  • Spotted by GitHub CodeQL vulnerability scanner
  • Related to: CWE-190, CWE-197 and CWE-835.

Detailed description

The type of the looping variable is smaller than the one used to end the loop. So it is possible to cause an infinite loop because of the wraparound.

Test plan

Probably next is affected too. But i'm lazy to test other branches right now.

Closing issues

There are no issues refering to this issue

* Spotted by GitHub CodeQL vulnerability scanner
* Related to: CWE-190, CWE-197 and CWE-835.
@Rot127 Rot127 merged commit 3f87ce0 into capstone-engine:v5 May 17, 2024
6 checks passed
Rot127 added a commit to Rot127/capstone that referenced this pull request May 17, 2024
@Rot127 Rot127 mentioned this pull request May 17, 2024
2 tasks
Rot127 added a commit to Rot127/capstone that referenced this pull request May 18, 2024
kabeor pushed a commit that referenced this pull request May 18, 2024
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.

4 participants