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

ignore number_entry_cd #827

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Conversation

Coeur
Copy link
Contributor

@Coeur Coeur commented Nov 13, 2024

Fix #822.

I opted for ignoring number_entry_cd instead of attempting to recover cd because the cd recovery method doesn't work when the split_stream isn't configured. mz_zip_recover_cd is going to use mz_stream_os_tell instead of mz_stream_split_tell and recovery will fail.

An alternative to my fix would be:

  1. First to add zip->recover = 1 inside unzOpen_MZ,
  2. and second to add some split_stream support inside unzOpen_MZ ... which I don't know how to.

(if you know how to add split_stream support to unzOpen_MZ, then feel free to supersede my fix with yours.

Although, in my opinion, the streaming mode ignores CD, so why bothering verifying if number_entry_cd is valid?

@nmoinvaz
Copy link
Member

I will need some time to think about this.

@Coeur
Copy link
Contributor Author

Coeur commented Nov 15, 2024

On a note, the sample archive that we're trying to open was shared 6 years ago here: ZipArchive/ZipArchive#478
And there is no context where it came from or what tool was used to make it.
@LiuDeng can you tell us where that Books.zip is from, or how it was built? What is the normal app to open that book?

[edit: I don't really expect LiuDeng to answer, as their last activity on GitHub seems to be around 2020 (https://github.com/LiuDeng?tab=repositories)]

@zlib-ng zlib-ng deleted a comment from AannhTonn Nov 17, 2024
@Coeur Coeur force-pushed the coeur/number_entry_cd branch from 4dba068 to fa920de Compare November 18, 2024 02:16
@Coeur
Copy link
Contributor Author

Coeur commented Nov 18, 2024

@nmoinvaz I've improved the logic to only skip number_entry_cd when recover is true.
And I've added a minimal test file in the fuzz folder.

@nmoinvaz nmoinvaz merged commit 6d45beb into zlib-ng:develop Nov 18, 2024
28 checks passed
@Coeur Coeur deleted the coeur/number_entry_cd branch November 19, 2024 03:56
@AannhTonn
Copy link

....?

@AannhTonn
Copy link

có ai không liên lạc lại cho tôi với....?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Archive cannot be unzipped with unzOpen_MZ but works with mz_zip_reader_open_file
3 participants