Skip to content

Commit

Permalink
Fixes OleID constructor
Browse files Browse the repository at this point in the history
It's necessary to set self.data if data is not None.

Fixes: decalage2#695

Signed-off-by: Jürgen Löhel <[email protected]>
  • Loading branch information
jloehel authored and c-rosenberg committed Dec 2, 2021
1 parent 11c4f2b commit 6f29d7a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions oletools/oleid.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ def __init__(self, filename=None, data=None):
self.file_on_disk = True # useful for some check that don't work in memory
with open(filename, 'rb') as f:
self.data = f.read()
else:
self.data = data
self.data_bytesio = io.BytesIO(self.data)
if isinstance(filename, olefile.OleFileIO):
self.ole = filename
Expand Down

0 comments on commit 6f29d7a

Please sign in to comment.