diff options
author | Jan Kotas <jkotas@microsoft.com> | 2018-03-13 17:00:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-13 17:00:50 -0700 |
commit | e7ff0e4bf1265d5bfc3357f89c56d3815a714e0c (patch) | |
tree | 63e34683d8580fe2032b7888440c2c449d33c9ba /src/vm/peimage.cpp | |
parent | 1f48b29ed0c9da48ca2d30df2a308fb620d8c22f (diff) | |
download | coreclr-e7ff0e4bf1265d5bfc3357f89c56d3815a714e0c.tar.gz coreclr-e7ff0e4bf1265d5bfc3357f89c56d3815a714e0c.tar.bz2 coreclr-e7ff0e4bf1265d5bfc3357f89c56d3815a714e0c.zip |
Revert "Revert "Fix handling of incorrect assemblies on Unix (#16747)" (#16790)" (#16917)
This reverts commit 47bef69b68a35eafa069d08187727684a5f47901.
Diffstat (limited to 'src/vm/peimage.cpp')
-rw-r--r-- | src/vm/peimage.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vm/peimage.cpp b/src/vm/peimage.cpp index 3536b08361..83989f0e4d 100644 --- a/src/vm/peimage.cpp +++ b/src/vm/peimage.cpp @@ -1029,7 +1029,9 @@ PTR_PEImageLayout PEImage::CreateLayoutFlat(BOOL bPermitWriteableSections) PTR_PEImageLayout pFlatLayout = PEImageLayout::LoadFlat(GetFileHandle(),this); - if (!bPermitWriteableSections && pFlatLayout->HasWriteableSections()) + if (!bPermitWriteableSections + && pFlatLayout->CheckNTHeaders() + && pFlatLayout->HasWriteableSections()) { pFlatLayout->Release(); @@ -1114,8 +1116,7 @@ void PEImage::Load() #ifdef PLATFORM_UNIX if (m_pLayouts[IMAGE_FLAT] != NULL - && m_pLayouts[IMAGE_FLAT]->CheckFormat() - && m_pLayouts[IMAGE_FLAT]->IsILOnly() + && m_pLayouts[IMAGE_FLAT]->CheckILOnlyFormat() && !m_pLayouts[IMAGE_FLAT]->HasWriteableSections()) { // IL-only images with writeable sections are mapped in general way, |