This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: binascii.crc_hqx() can return negative integer
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.4, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: gregory.p.smith, python-dev, serhiy.storchaka
Priority: normal Keywords: easy, patch

Created on 2015-03-20 21:52 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
binascii_crc_hqx_empty_data.patch serhiy.storchaka, 2015-04-04 19:18 review
Messages (3)
msg238726 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-03-20 21:52
zlib.adler32(), zlib.crc32(), and binascii.crc32() always return 32-bit unsigned integer in Python 3. binascii.crc_hqx() almost always returns 16-bit unsigned integer. But there is an exception. The result can negative only when arguments of binascii.crc_hqx() are empty bytes and negative integer. This looks as a bug and should be fixed. But may be no need to apply changes to maintained releases.
msg240087 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-04-04 19:17
Nobody proposed a patch, so I do this.
msg241616 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-04-20 06:33
New changeset 0ead02929df2 by Serhiy Storchaka in branch '3.4':
Issue #23728: binascii.crc_hqx() could return an integer outside of the range

New changeset abb86c6b11b2 by Serhiy Storchaka in branch 'default':
Issue #23728: binascii.crc_hqx() could return an integer outside of the range

New changeset 17702fd8ac0d by Serhiy Storchaka in branch '2.7':
Issue #23728: Added a test for binascii.crc_hqx().
Date User Action Args
2022-04-11 14:58:14adminsetgithub: 67916
2015-04-20 08:25:22serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2015-04-20 06:33:21python-devsetnosy: + python-dev
messages: + msg241616
2015-04-04 19:18:25serhiy.storchakasetfiles: + binascii_crc_hqx_empty_data.patch
assignee: serhiy.storchaka
stage: needs patch -> patch review
keywords: + patch
versions: + Python 3.4
2015-04-04 19:17:56serhiy.storchakasetmessages: + msg240087
2015-03-20 21:52:50serhiy.storchakacreate