This commit is contained in:
Nazarii 2016-12-09 11:45:36 +00:00 committed by GitHub
commit 3b5f4b8684

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: