mdsteele / rust-cab

Rust library for encoding/decoding Windows cabinet (.cab) files
MIT License
15 stars 8 forks source link

Errors on read files from CAB archive #11

Closed ikrivosheev closed 1 year ago

ikrivosheev commented 3 years ago

Hello, thank you for the library.

I open LibreOffice installer with rust-msi. Then open libreoffice1.cab stream with this library and get some erros:

_d0000002.html unpacker error=UnpackError { err: Custom { kind: Other, error: ChunkTooLong }, kind: WriteTmpFile }
_d0000005.html unpacker error=UnpackError { err: Custom { kind: Other, error: ChunkTooLong }, kind: WriteTmpFile }
...
_d5250200.html unpacker error=UnpackError { err: Custom { kind: Other, error: UnexpectedEof }, kind: WriteTmpFile }
...
undo_formatting.html unpacker error=UnpackError { err: Custom { kind: Other, error: UnexpectedEof }, kind: WriteTmpFile }
mdsteele commented 3 years ago

I tried to reproduce this, starting with these steps:

  1. Download https://www.libreoffice.org/donate/dl/win-x86_64/7.2.2/en-US/LibreOffice_7.2.2_Win_x64.msi
  2. From rust-msi repo, run cargo run --release --example msiinfo -- extract LibreOffice_7.2.2_Win_x64.msi libreoffice1.cab > libreoffice1.cab
  3. From rust-cab repo, run cargo run --example cabtool -- ls libreoffice1.cab | less

But the files listed in the cabinet in step 3 didn't include anything named _d0000002.html or undo_formatting.html. Could you give a little more detail on what you're doing that's printing the lines you got above?

I note that ChunkTooLong seems to be an error generated by the lzxd crate, so possibly the bug is with that crate rather than cab, but I can't be sure. Have you seen these kinds of errors with any other cabinet files that are smaller than this one?

ikrivosheev commented 1 year ago

It's a double: https://github.com/mdsteele/rust-cab/issues/14.