mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #16411: Fix a bug where zlib.decompressobj().flush() might try to access previously-freed memory.
Patch by Serhiy Storchaka.
This commit is contained in:
parent
ee7889dec3
commit
7ee955550b
3 changed files with 17 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue