From 6f29d7aba8ecddd3b5b3eee0b5f4188a7a1a96a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20L=C3=B6hel?= Date: Mon, 14 Jun 2021 18:09:38 -0500 Subject: [PATCH] Fixes OleID constructor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's necessary to set self.data if data is not None. Fixes: #695 Signed-off-by: Jürgen Löhel --- oletools/oleid.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oletools/oleid.py b/oletools/oleid.py index 8e57c69d..cb76ac7b 100644 --- a/oletools/oleid.py +++ b/oletools/oleid.py @@ -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