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
zlib module is not completly 64-bit safe #62494
Comments
Attached patch fixes different compiler warnings on Windows x64 in the zlib module. The module raises OverflowError if some values are longer than INT_MAX, but not all parameters are checked. |
Related issue: bpo-9566. |
The changeset 931e1bc090f6 fixes warnings in adler32 and crc32. |
@serhiy: Oh, thanks for your review. My patch was far from being perfect, a review was necessary! (I hesitated to commit it directly.) Here is a new patch using unsigned int is most places, parsing arguments with "I" format, and explicit cast to (size_t) to not compare unsigned with signed. |
"Here is a new patch using unsigned int is most places, parsing Oh oh, it's still wrong. The "I" parser format does not check for |
Ping myself. |
The "O" format can be used with _PyLong_AsInt() instead. |
zlib_64bit-3.patch: updated patch which fixes also the PyArg_ParseTuple() convert for C int and C unsigned int. |
zlib_64bit-4.patch:
|
LGTM. |
New changeset f947fe289db8 by Victor Stinner in branch 'default': |
I changed the "uint" parser to raise a ValueError instead of an OverflowError, so the unit test doesn't need to be adapted. Thanks again Serhiy for your review :) I doesn't want to backport the fix to Python 2.7 or 3.3, it's more intrusive than what I expected. I opened the issue to fix compiler warnings, it's not like an user complained about a crash. |
New changeset 0cca6c5513d2 by Victor Stinner in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: