Added check for incomplete file in container unpacking

This commit is contained in:
Rob McMullen 2018-07-16 07:03:47 -07:00
parent cdac32238e
commit 5f5e911d10

View File

@ -23,7 +23,10 @@ class DiskImageContainer:
def __unpack_raw_data(self, data):
raw = data.tobytes()
unpacked = self.unpack_bytes(raw)
try:
unpacked = self.unpack_bytes(raw)
except EOFError as e:
raise errors.InvalidContainer(e)
return to_numpy(unpacked)
def unpack_bytes(self, byte_data):