Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-41486: Fix initial buffer size can't > UINT32_MAX in zlib module #25738

Merged
merged 3 commits into from Apr 30, 2021
Merged

bpo-41486: Fix initial buffer size can't > UINT32_MAX in zlib module #25738

merged 3 commits into from Apr 30, 2021

Conversation

ghost
Copy link

@ghost ghost commented Apr 30, 2021

After commit f9bedb6, in 64-bit build,
if the initial buffer size > UINT32_MAX, ValueError will be raised.

These two functions are affected:

  1. zlib.decompress(data, /, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE)
  2. zlib.Decompress.flush([length])

This commit re-allows the size > UINT32_MAX.

https://bugs.python.org/issue41486

After commit f9bedb6, in 64-bit build,
if the initial buffer size > UINT32_MAX, ValueError will be raised.

These two functions are affected:
1. zlib.decompress(data, /, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE)
2. zlib.Decompress.flush([length])

This commit re-allows the size > UINT32_MAX.
@gpshead gpshead self-assigned this Apr 30, 2021
@gpshead gpshead added type-bug An unexpected behavior, bug, or error type-feature A feature request or enhancement labels Apr 30, 2021
Modules/zlibmodule.c Show resolved Hide resolved
@gpshead gpshead merged commit 251ffa9 into python:master Apr 30, 2021
@ghost ghost deleted the zlib_init_size branch May 1, 2021 05:18
kreathon pushed a commit to kreathon/cpython that referenced this pull request May 2, 2021
…ythonGH-25738)

* Fix initial buffer size can't > UINT32_MAX in zlib module

After commit f9bedb6, in 64-bit build,
if the initial buffer size > UINT32_MAX, ValueError will be raised.

These two functions are affected:
1. zlib.decompress(data, /, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE)
2. zlib.Decompress.flush([length])

This commit re-allows the size > UINT32_MAX.

* adds curly braces per PEP 7.

* Renames `Buffer_*` to `OutputBuffer_*` for clarity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news type-bug An unexpected behavior, bug, or error type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants