Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isOleFile triggers an error when passing data of a small non-OLE file #142

Closed
decalage2 opened this issue May 9, 2021 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@decalage2
Copy link
Owner

issue: the filename parameter of isOleFile can be either the path of the file to open on disk, or a bytes string containing the data of the file. If filename is less than 1536 bytes, isOleFile assumes that it's a filename and not data. This is fine for OLE files, because 1536 bytes is the minimal size of an OLE file.
But when we want to check a non-OLE file, this fails for files smaller than 1536 bytes, for applications passing data in the filename parameter instead of an actual filename.

Solution: add a second parameter data, set to None by default. If data contains a bytes string, then isOleFile should use it directly and ignore filename.
This should not break applications using only filename.

@decalage2 decalage2 added the bug label May 9, 2021
@decalage2 decalage2 added this to the olefile 0.47 milestone May 9, 2021
@decalage2 decalage2 self-assigned this May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant