fix issue 7
This commit is contained in:
@@ -463,8 +463,9 @@ 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
|
||||||
raise InvalidSize("Impossible to read type %s : read length is too small"%(self.__class__))
|
if not self.__dict__[name]._optional:
|
||||||
|
raise InvalidSize("Impossible to read type %s : read length is too small"%(self.__class__))
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error("Error during read %s::%s"%(self.__class__, name))
|
log.error("Error during read %s::%s"%(self.__class__, name))
|
||||||
|
|||||||
Reference in New Issue
Block a user