Skip to content

Commit

Permalink
Avoid exceptions for malformed debug headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jbevain committed Aug 2, 2019
1 parent 1ac62c6 commit b2d248c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Mono.Cecil.PE/ImageReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void ReadDebugHeader ()
PointerToRawData = ReadInt32 (),
};

if (directory.PointerToRawData == 0) {
if (directory.PointerToRawData == 0 || directory.SizeOfData < 0) {
entries [i] = new ImageDebugHeaderEntry (directory, Empty<byte>.Array);
continue;
}
Expand Down

0 comments on commit b2d248c

Please sign in to comment.