summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2012-11-11 02:15:32 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2012-11-11 02:15:32 (GMT)
commit7ee955550b27af117ddca61deb061e13423cf24b (patch)
tree5af7af0e38d0a8163b651250cf5b0c70c76253cc /Modules
parentee7889dec321654d1c50448de7987e1841dd3ad5 (diff)
downloadcpython-7ee955550b27af117ddca61deb061e13423cf24b.zip
cpython-7ee955550b27af117ddca61deb061e13423cf24b.tar.gz
cpython-7ee955550b27af117ddca61deb061e13423cf24b.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')
-rw-r--r--Modules/zlibmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
index 6d4aa3a..6a772ad 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -883,6 +883,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);