mdsteele / rust-cfb

Rust library for reading/writing Compound File Binary (structured storage) files
MIT License
46 stars 20 forks source link

Malformed directory entry (invalid storage start sector: 0x3a) #27

Closed ikrivosheev closed 2 years ago

ikrivosheev commented 2 years ago

Hello! Thank you for the great library. I get error when try to open file: Custom { kind: InvalidData, error: "Malformed directory entry (invalid storage start sector: 0x3a)" }

File: qalt_attach_240-2087.zip

mdsteele commented 2 years ago

Thanks! This is yet another case where the cfb crate is being stricter than really necessary. Section 2.6.3 of the CFB spec says that storage directory entries should have the Starting Sector Location and Stream Size fields set to zero, but the CFB file you attached has nonzero values for both (in at least one storage entry). Just like with issue #26, we can just ignore the invalid values and pretend they were set to zero. I'll make a fix.

ikrivosheev commented 2 years ago

@mdsteele thank you for the fix! Can you make a fix release with these changes?

mdsteele commented 2 years ago

Yep, just published v0.7.2 with this fix.