Skip to content

Conversation

@ShreyaLaxminarayan
Copy link

Summary:
This PR fixes a logic error in AsmMan::EndAssembly() that incorrectly treated a successful fread() call as a failure. The incorrect condition:

dwBytesRead = fread(m_sStrongName.m_pbPublicKey, 1, m_sStrongName.m_cbPublicKey, fp)) <= m_sStrongName.m_cbPublicKey)

causes the error branch to execute even when the full key file has been read successfully (dwBytesRead == m_sStrongName.m_cbPublicKey).
This results in ilasm failing to read .snk key files when building TestILAssembly on Big Endian Systems.

Environment:
Architecture: s390x
OS: Ubuntu
Runtime : Mono

cc: @uweigand @giritrivedi @saitama951

Summary
This PR fixes a logic error in AsmMan::EndAssembly() that incorrectly treated a successful fread() call as a failure.
The incorrect condition:
```
dwBytesRead = fread(m_sStrongName.m_pbPublicKey, 1, m_sStrongName.m_cbPublicKey, fp)) <= m_sStrongName.m_cbPublicKey)
```
causes the error branch to execute even when the full key file has been read successfully (dwBytesRead == m_sStrongName.m_cbPublicKey).
This results in ilasm failing to read .snk key files when building TestILAssembly on big Endian Systems.

Environment:
Architecture: s390x
OS: Ubuntu
Runtime : Mono

cc: @uweigand @giritrivedi @saitama951
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Nov 20, 2025
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 20, 2025
@huoyaoyuan
Copy link
Member

Introduced in #116203. Do we have strong name coverage in the repo at all?

@huoyaoyuan huoyaoyuan added area-ILTools-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 20, 2025
@dotnet-policy-service
Copy link
Contributor

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

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

Labels

area-ILTools-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants