[New-bugs-announce] [issue8650] zlibmodule.c isn't 64-bit clean

Antoine Pitrou report at bugs.python.org
Fri May 7 19:21:01 CEST 2010

New submission from Antoine Pitrou <pitrou at free.fr>:

zlibmodule.c doesn't define PY_SSIZE_T_CLEAN, and uses lots of "int" variables for length values internally.
Besides, the zlib itself uses "uInt" and "uLong" variables in its z_stream structure (rather than something guaranteed to be at least the width of a pointer).

On large input data, this will conspire to produce bogus results or crashes. For example:

>>> s = 'x' * (4 * 1024**3 + 100)
>>> t = zlib.compress(s, 1)
>>> len(t)
>>> len(zlib.decompress(t))

components: Extension Modules
messages: 105216
nosy: gregory.p.smith, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: zlibmodule.c isn't 64-bit clean
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list