Skip to content

Comments

[ilasm] Fix possible overflow before hitting loop bound in ilasm/writer.cpp#124116

Closed
adamperlin wants to merge 1 commit intodotnet:mainfrom
adamperlin:adamperlin/ilasm-codeql-fix-SM01928
Closed

[ilasm] Fix possible overflow before hitting loop bound in ilasm/writer.cpp#124116
adamperlin wants to merge 1 commit intodotnet:mainfrom
adamperlin:adamperlin/ilasm-codeql-fix-SM01928

Conversation

@adamperlin
Copy link
Contributor

@adamperlin adamperlin commented Feb 7, 2026

This is a possible issue detected by CodeQL which needs to be addressed.

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib
See info in area-owners.md if you want to be subscribed.

@adamperlin adamperlin changed the title [ilasmFix possible overflow before hitting loop bound in ilasm/writer.cpp [ilasm] Fix possible overflow before hitting loop bound in ilasm/writer.cpp Feb 7, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a potential signed overflow in ILASM metadata stream iteration by widening the loop counter type, preventing incorrect looping behavior when the stream count exceeds the range of a signed 16-bit integer.

Changes:

  • Change the metadata stream loop index from short to int to avoid overflow before reaching the loop bound.

@adamperlin
Copy link
Contributor Author

/azp run dotnet-runtime-codeql

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant