olefile icon indicating copy to clipboard operation
olefile copied to clipboard

Lazy parsing

Open decalage2 opened this issue 8 years ago • 0 comments

For now, olefile reads and parses most of the OLE structures (header, FAT, directory, miniFAT) right away when creating an OleFileIO object. It fails with an exception whenever any of those structures has an issue.

When handling malformed files such as malicious documents, it would be better to only read the header at object creation, and then read/parse the other structures only when required. It would then be possible to access header information even if the other parts are incorrect.

Drawback: some applications may rely on the old behaviour. And it means that all data access must be done through methods, no direct access to attributes anymore.

decalage2 avatar Jul 01 '17 09:07 decalage2