Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJb Evain <jbevain@gmail.com>2014-09-02 15:56:16 +0400
committerMiguel de Icaza <miguel@gnome.org>2014-09-02 18:47:51 +0400
commit33d50b874fd527118bc361d83de3d494e8bb55e1 (patch)
tree1639888ba69b29e09d8ea990689fdf623f74a45e
parentc56601ce978a9246eba17e19f1e5c15f49e4f102 (diff)
Handle zeroed debug header. Fix #174mono-legacy-0.9.5
-rw-r--r--Mono.Cecil.PE/Image.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Mono.Cecil.PE/Image.cs b/Mono.Cecil.PE/Image.cs
index a11cf1c..fdecbbe 100644
--- a/Mono.Cecil.PE/Image.cs
+++ b/Mono.Cecil.PE/Image.cs
@@ -150,6 +150,11 @@ namespace Mono.Cecil.PE {
PointerToRawData = buffer.ReadInt32 (),
};
+ if (directory.SizeOfData == 0 || directory.PointerToRawData == 0) {
+ header = Empty<byte>.Array;
+ return directory;
+ }
+
buffer.position = (int) (directory.PointerToRawData - section.PointerToRawData);
header = new byte [directory.SizeOfData];