-Added a check to verify the expected amount of data is read when parsing the import table (thanks to Angelo Dell'Aera for reporting it).

git-svn-id: http://pefile.googlecode.com/svn/trunk@141 8842bc4e-7134-0410-8230-5dc5194fb5c1
diff --git a/pefile.py b/pefile.py
index 1afb9d6..5b20cda 100644
--- a/pefile.py
+++ b/pefile.py
@@ -3911,9 +3911,13 @@
                 max(addresses_of_data_set_64) - min(addresses_of_data_set_64) > MAX_ADDRESS_SPREAD ):
                 return []
 
+            failed = False
             try:
                 data = self.get_data(rva, Structure(format).sizeof())
             except PEFormatError, e:
+                failed = True
+
+            if failed or len(data) != Structure(format).sizeof():
                 self.__warnings.append(
                     'Error parsing the import table. ' +
                     'Invalid data at RVA: 0x%x' % rva)