FIX: fixed isOleFile issue when passing file content with len < MINIMAL_OLEFILE_SIZE

This commit is contained in:
Nazarii Gudzovatyi 2016-11-22 17:47:21 +02:00
parent 2e178d7dbb
commit 70c5367c33

View File

@ -453,6 +453,9 @@ def isOleFile(filename):
# filename is a bytes string containing the OLE file to be parsed:
header = filename[:len(MAGIC)]
else:
if len(filename) < MINIMAL_OLEFILE_SIZE:
return False
# string-like object: filename of file on disk
header = open(filename, 'rb').read(len(MAGIC))
if header == MAGIC: