PEReader does not throw BadImageFormatException for some invalid PE files #48419
Labels
area-System.Reflection.Metadata
enhancement
Product code improvement that does NOT require public API changes/additions
help wanted
[up-for-grabs] Good issue for external contributors
Milestone
Description
Creating a
PEReader
for an invalid file type, such as an ELF can sometimes lead to a situation where thePEReader
thinks the file is valid and it will return garbage data, causing errors to occur downstream.Attached is a zipfile containing an ELF which reproduces the issue, trimmed using
dd
to reduce its filesize while still reproducing the issue.Here's the code I'm running:
Running the same code on a different ELF file throws a
BadImageFormatException
, as expected.Configuration
.NET SDK/Runtime info
The text was updated successfully, but these errors were encountered: