olefile
olefile copied to clipboard
Lazy parsing
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.