Skip to content

Only actually set window size after checking it with wbits=0 - #610

Merged
Gelbpunkt merged 1 commit into
mainfrom
fix-wbits-0-window-over-32k
Nov 24, 2026
Merged

Gelbpunkt merged 1 commit into
mainfrom
fix-wbits-0-window-over-32k

Conversation

@Gelbpunkt

Copy link
Copy Markdown
Member

With wbits=0, we would set the window size before checking whether it was valid. This would then hit an assert inside of set_size. Fix it by checking the new window size before setting it.

Closes #609

@Gelbpunkt
Gelbpunkt requested a review from folkertdev November 24, 2026 18:17
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
fuzz-compress 39.59% <50.00%> (+0.37%) ⬆️
fuzz-decompress 26.86% <0.00%> (ø)
test-aarch64-apple-darwin 91.20% <100.00%> (ø)
test-aarch64-unknown-linux-gnu 91.07% <100.00%> (ø)
test-i686-unknown-linux-gnu 91.35% <100.00%> (ø)
test-x86_64-apple-darwin 90.34% <100.00%> (-0.02%) ⬇️
test-x86_64-unknown-linux-gnu 90.83% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
zlib-rs/src/inflate.rs 94.34% <100.00%> (+0.27%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Gelbpunkt
Gelbpunkt force-pushed the fix-wbits-0-window-over-32k branch from efa79d9 to 952c17c Compare November 24, 2026 18:22

@folkertdev folkertdev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two comment requests, feel free to merge this with those fixed.

Comment thread test-libz-rs-sys/src/inflate.rs Resolved
Comment thread zlib-rs/src/inflate.rs Resolved
With wbits=0, we would set the window size before checking whether it
was valid. This would then hit an assert inside of set_size. Fix it by
checking the new window size before setting it.

Closes #609
@Gelbpunkt
Gelbpunkt force-pushed the fix-wbits-0-window-over-32k branch from 952c17c to e869c75 Compare November 24, 2026 19:33
@Gelbpunkt
Gelbpunkt merged commit dac3c0a into main Nov 24, 2026
41 checks passed
@Gelbpunkt
Gelbpunkt deleted the fix-wbits-0-window-over-32k branch November 24, 2026 19:44
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.

inflate with window_bits = 0 panics on a zlib header declaring a window above 32 KiB (0.6.9 regression)

2 participants