summaryrefslogtreecommitdiffstats
path: root/Modules/zlibmodule.c
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2012-11-11 02:19:49 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2012-11-11 02:19:49 (GMT)
commit9c40022e38ba250c84382e4a4e68a05c0024559d (patch)
tree81d54b2a6ff416414ef874ec23a470dc713a5bf2 /Modules/zlibmodule.c
parent9ea64e38b5e1b947fef9e53e3f63994b79e264e7 (diff)
parentec6dfcffa05414e7ee29cfe88551a3d3dcdaafdc (diff)
downloadcpython-9c40022e38ba250c84382e4a4e68a05c0024559d.zip
cpython-9c40022e38ba250c84382e4a4e68a05c0024559d.tar.gz
cpython-9c40022e38ba250c84382e4a4e68a05c0024559d.tar.bz2
Issue #16411: Fix a bug where zlib.decompressobj().flush() might try to access previously-freed memory.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Modules/zlibmodule.c')
-rw-r--r--Modules/zlibmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
index 9e1c2ae..213859f 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -975,6 +975,8 @@ PyZlib_unflush(compobject *self, PyObject *args)
ENTER_ZLIB(self);
start_total_out = self->zst.total_out;
+ self->zst.avail_in = PyBytes_GET_SIZE(self->unconsumed_tail);
+ self->zst.next_in = (Byte *)PyBytes_AS_STRING(self->unconsumed_tail);
self->zst.avail_out = length;
self->zst.next_out = (Byte *)PyBytes_AS_STRING(retval);