Skip to content

gh-158169: Clear zlib.Decompress.unconsumed_tail at end of stream - #158177

Merged
StanFromIreland merged 3 commits into
python:mainfrom
GruffElixir:gh-158169-zlib-unconsumed-tail
Sep 26, 2026
Merged

StanFromIreland merged 3 commits into
python:mainfrom
GruffElixir:gh-158169-zlib-unconsumed-tail

Conversation

@GruffElixir

@GruffElixir GruffElixir commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #158169.\n\nWhen decompression reaches EOF after a max_length-limited call, trailing bytes are copied to unused_data. Advance next_in past those bytes so the unconsumed_tail update clears them instead of exposing the same bytes through both attributes.\n\nAdds a regression test for limited decompression with trailing input.\n\nValidation:\n- Windows Debug build with PCbuild/build.bat\n- PCbuild/amd64/python_d.exe -m test -v test_zlib\n- PCbuild/amd64/python_d.exe -m test -R 3:2 test_zlib\n- Tools/patchcheck/patchcheck.py

Copilot AI lite review requested due to automatic review settings September 25, 2026 16:54
@python-cla-bot

python-cla-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

This comment was marked as spam.

@GruffElixir
GruffElixir force-pushed the gh-158169-zlib-unconsumed-tail branch from 5f97915 to 7d19724 Compare September 25, 2026 16:56
Comment thread Lib/test/test_zlib.py Outdated
Comment thread Misc/NEWS.d/next/Library/2026-09-25-22-15-54.gh-issue-158169.ZlibTail.rst Outdated
Comment thread Modules/zlibmodule.c Outdated
@StanFromIreland StanFromIreland changed the title gh-158169: Clear Decompress.unconsumed_tail at EOF gh-158169: Clear zlib.Decompress.unconsumed_tail at end of stream Sep 26, 2026
@StanFromIreland
StanFromIreland merged commit 8122ff4 into python:main Sep 26, 2026
59 checks passed
@StanFromIreland StanFromIreland added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Sep 26, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @GruffElixir for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @GruffElixir for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @GruffElixir for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington-app

Copy link
Copy Markdown

Sorry, @GruffElixir and @StanFromIreland, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 8122ff4818f418e8ae984cf6964215689b00808d 3.13

@miss-islington-app

Copy link
Copy Markdown

Sorry, @GruffElixir and @StanFromIreland, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 8122ff4818f418e8ae984cf6964215689b00808d 3.14

@bedevere-app

bedevere-app Bot commented Sep 26, 2026

Copy link
Copy Markdown

GH-158228 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Sep 26, 2026
@bedevere-app

bedevere-app Bot commented Sep 26, 2026

Copy link
Copy Markdown

GH-158229 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 26, 2026
@StanFromIreland StanFromIreland removed the needs backport to 3.13 bugs and security fixes label Sep 26, 2026
@GruffElixir
GruffElixir deleted the gh-158169-zlib-unconsumed-tail branch September 26, 2026 13:21
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.

zlib: Decompress.unconsumed_tail should be cleared on eof

3 participants