gh-158169: Clear zlib.Decompress.unconsumed_tail at end of stream - #158177
Conversation
5f97915 to
7d19724
Compare
zlib.Decompress.unconsumed_tail at end of stream
|
Thanks @GruffElixir for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @GruffElixir for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Thanks @GruffElixir for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
Sorry, @GruffElixir and @StanFromIreland, I could not cleanly backport this to |
|
Sorry, @GruffElixir and @StanFromIreland, I could not cleanly backport this to |
|
GH-158228 is a backport of this pull request to the 3.15 branch. |
|
GH-158229 is a backport of this pull request to the 3.14 branch. |
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