about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2021-09-04 18:07:06 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2021-09-04 18:07:06 +0200
commitf2c0c38b67b65e3f5309d358c59fcee9a501854d (patch)
tree4c5d12e728b4a237333be7245cf73325582e5f6c
parentdb8c1da4b7ae530ab44976056a6acc69cd22d967 (diff)
downloadmiasm-f2c0c38b67b65e3f5309d358c59fcee9a501854d.tar.gz
miasm-f2c0c38b67b65e3f5309d358c59fcee9a501854d.zip
Raise IOError on out of bound pe reading
-rw-r--r--miasm/loader/pe_init.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/miasm/loader/pe_init.py b/miasm/loader/pe_init.py
index 3e0c660e..202a7b00 100644
--- a/miasm/loader/pe_init.py
+++ b/miasm/loader/pe_init.py
@@ -46,8 +46,10 @@ class ContectRva(object):
         @rva_start: rva start address
         @rva_stop: rva stop address
         """
+        if rva_start is None:
+            raise IOError("Out of range")
         if rva_start < 0:
-            raise ValueError("Out of range")
+            raise IOError("Out of range")
         if rva_stop is not None:
             if rva_stop > len(self.parent.img_rva):
                 rva_stop = len(self.parent.img_rva)