Skip to content

Fix Zlib.gunzip with a header truncated in the file name or comment - #170

Merged
hsbt merged 2 commits into
masterfrom
claude/zlib-gunzip-header-cf594d
Oct 25, 2026
Merged

hsbt merged 2 commits into
masterfrom
claude/zlib-gunzip-header-cf594d

Conversation

@hsbt

@hsbt hsbt commented Oct 25, 2026

Copy link
Copy Markdown
Member

Zlib.gunzip raised NoMethodError instead of Zlib::GzipFile::Error when its input ended inside the original file name or comment of the gzip header. Reading the rest of the field went to the IO, which Zlib.gunzip does not have.

This adds the end-of-string check that the other header fields already go through, so the error is the same as for any other truncated header.

Generated with Claude Code

hsbt and others added 2 commits October 25, 2026 07:47
Reading the rest of the field went to the IO, which Zlib.gunzip does not have, instead of raising Zlib::GzipFile::Error as the other truncated header fields do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hsbt
hsbt merged commit cac2061 into master Oct 25, 2026
60 checks passed
@hsbt
hsbt deleted the claude/zlib-gunzip-header-cf594d branch October 25, 2026 03:39
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.

1 participant