Issue #8571: Fix an internal error when compressing or decompressing a
chunk larger than 1GB with the zlib module's compressor and decompressor
objects.
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
index 4f78dbc..0cb1e64 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -392,7 +392,8 @@
static PyObject *
PyZlib_objcompress(compobject *self, PyObject *args)
{
- int err, inplen, length = DEFAULTALLOC;
+ int err, inplen;
+ Py_ssize_t length = DEFAULTALLOC;
PyObject *RetVal;
Byte *input;
unsigned long start_total_out;
@@ -461,8 +462,8 @@
static PyObject *
PyZlib_objdecompress(compobject *self, PyObject *args)
{
- int err, inplen, old_length, length = DEFAULTALLOC;
- int max_length = 0;
+ int err, inplen, max_length = 0;
+ Py_ssize_t old_length, length = DEFAULTALLOC;
PyObject *RetVal;
Byte *input;
unsigned long start_total_out;