Skip to content

guard against uncomp_size overflow in zip_entry_decrypt_and_read#405

Merged
kuba-- merged 1 commit into
kuba--:masterfrom
jmestwa-coder:decrypt-read-uncomp-overflow
Jun 2, 2026
Merged

guard against uncomp_size overflow in zip_entry_decrypt_and_read#405
kuba-- merged 1 commit into
kuba--:masterfrom
jmestwa-coder:decrypt-read-uncomp-overflow

Conversation

@jmestwa-coder

Copy link
Copy Markdown
Contributor

A password-protected entry can declare uncomp_size = SIZE_MAX through a zip64 extra field, and malloc(uncomp_size + 1) in zip_entry_decrypt_and_read then wraps to malloc(0) while the decrypted bytes are still copied (stored) or inflated (deflated) in full.

Bail out with ZIP_EOOMEM before the allocation in both branches.

@kuba-- kuba-- merged commit 7747c44 into kuba--:master Jun 2, 2026
18 checks passed
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.

2 participants