[Zlib-devel] Negative argument wsize in "inflateInit2()"
Jesus Cea
jcea at jcea.es
Mon May 3 10:02:23 EDT 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I am studying a zlib related crash in Python code, when using to
zipimporter.
Tracking down the issue, I see this, in python "zipimport.c":
"""
data = PyObject_CallFunction(decompress, "Oi", raw_data, -15);
"""
This function will call "inflateInit2()" with the "-15" value for wsize.
Reading python docs, I see this:
http://docs.python.org/library/zlib.html#zlib.decompress . The scary
thing is the "undocumented" feature. I guess it was dropped in current
zlib library.
If I change the value to "15", I can not import zipped python modules
anymore. The importer needs more love to be able to work as before, with
wsize=15.
I would like to know if passing "-15" to zlib is still supported (but
undocumented) and I must keep investigating the problem, or that
functionality was eliminates in zlib 1.2.5 and I have to patch python (I
am a python core developer, so this is actually a posibility) to change
- -15 by 15 and estore the zipimport capability.
In the latter case I would like to know what I can do to be able to
decompress zip files again :). Maybe it is enough to skip some initial
bytes in the stream, maybe I have to generate a "fake" gzip header
internally... Any idea?.
Thanks for your time and attention.
- --
Jesus Cea Avion _/_/ _/_/_/ _/_/_/
jcea at jcea.es - http://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/
jabber / xmpp:jcea at jabber.org _/_/ _/_/ _/_/_/_/_/
. _/_/ _/_/ _/_/ _/_/ _/_/
"Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/
"My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQCVAwUBS97Xbplgi5GaxT1NAQLkywP/eue/NHIk4ygMCflYXtPtjcp418xrkEVU
QeLYlx85RyNrt9Yd5TW8yrO2LJhyYDzIQ1dtIpIlhCbHgd5cS3AAFKYoRCa+R6pt
a2oDDlvmnIDzj2wXJd/h2Us7b6mFWFLhG/QGwvbVNjX8naC+v/AzaGasttcyZmTb
Bo0b+gAYFIs=
=E/ph
-----END PGP SIGNATURE-----
More information about the Zlib-devel
mailing list