Commit fed2757
authored
Fix incorrect fread return value check in ilasm strong-name key loading (#121837)
**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 @saitama9511 parent 5e7ef6b commit fed2757
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
| 440 | + | |
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| |||
0 commit comments