Fix incorrect fread return value check in ilasm strong-name key loading#121837
Fix incorrect fread return value check in ilasm strong-name key loading#121837jkotas merged 2 commits intodotnet:mainfrom
Conversation
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
|
Introduced in #116203. Do we have strong name coverage in the repo at all? |
|
Tagging subscribers to this area: @JulieLeeMSFT |
|
There is only very limited strong-name coverage in the repo, and none for the ilasm key-file reading that #116203 modified. |
|
@Dotnet-s390x build |
|
Build Queued.. To cancel the current build, please comment: |
|
Build Successful |
|
@JulieLeeMSFT @huoyaoyuan The s390x CI is failing because of this, can this be merged? |
|
There are multiple ilasm failures in last CI build, and the build has expired. Can you merge and rerun them to see if they are related? /cc @jkotas |
Summary:
This PR fixes a logic error in AsmMan::EndAssembly() that incorrectly treated a successful fread() call as a failure. The incorrect condition:
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