Added check for incomplete file in container unpacking
This commit is contained in:
parent
cdac32238e
commit
5f5e911d10
|
@ -23,7 +23,10 @@ class DiskImageContainer:
|
||||||
|
|
||||||
def __unpack_raw_data(self, data):
|
def __unpack_raw_data(self, data):
|
||||||
raw = data.tobytes()
|
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)
|
return to_numpy(unpacked)
|
||||||
|
|
||||||
def unpack_bytes(self, byte_data):
|
def unpack_bytes(self, byte_data):
|
||||||
|
|
Loading…
Reference in New Issue