fix issue 7

This commit is contained in:
speyrefitte
2014-12-02 16:07:33 +01:00
parent bd91093617
commit 9419bea9b0

View File

@@ -463,7 +463,8 @@ class CompositeType(Type):
if not self._readLen is None and readLen > self._readLen.value: if not self._readLen is None and readLen > self._readLen.value:
#roll back #roll back
s.pos -= sizeof(self.__dict__[name]) s.pos -= sizeof(self.__dict__[name])
#and notify #and notify if not optional
if not self.__dict__[name]._optional:
raise InvalidSize("Impossible to read type %s : read length is too small"%(self.__class__)) raise InvalidSize("Impossible to read type %s : read length is too small"%(self.__class__))
except Exception as e: except Exception as e: