[New-bugs-announce] [issue1372] zlibmodule.c: int overflow in PyZlib_decompress

Peter Weseloh report at bugs.python.org
Fri Nov 2 11:39:31 CET 2007

New submission from Peter Weseloh:

When I use zlib.decompress to decompress a string where the result would
be >1 GB I get
SystemError: Objects/stringobject.c:4089: bad argument to internal function

I tracked that down to an int overflow of r_strlen in PyZlib_decompress.
Using Py_ssize_t instead of int solved this for me (on 64bit Linux).

The patch is against
Revision: 56476

Kind regards,

components: Extension Modules
files: int_overflow.diff
messages: 57047
nosy: PeterW
severity: normal
status: open
title: zlibmodule.c: int overflow in PyZlib_decompress
type: crash
versions: Python 2.5
Added file: http://bugs.python.org/file8676/int_overflow.diff

Tracker <report at bugs.python.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: int_overflow.diff
Type: application/octet-stream
Size: 386 bytes
Desc: not available
Url : http://mail.python.org/pipermail/new-bugs-announce/attachments/20071102/0c946def/attachment.obj 

More information about the New-bugs-announce mailing list