Fix dangling input pointer after `MemoryError` in _lzma/_bz2/_ZlibDecompressor.decompress
--- /dev/null
+Fix a dangling input pointer in :class:`lzma.LZMADecompressor`,
+:class:`bz2.BZ2Decompressor`, and internal :class:`!zlib._ZlibDecompressor`
+when memory allocation fails with :exc:`MemoryError`, which could let a
+subsequent :meth:`!decompress` call read or write through a stale pointer to
+the already-released caller buffer.
return result;
error:
+ bzs->next_in = NULL;
Py_XDECREF(result);
return NULL;
}
return result;
error:
+ lzs->next_in = NULL;
Py_XDECREF(result);
return NULL;
}
return result;
error:
+ self->zst.next_in = NULL;
Py_XDECREF(result);
return NULL;
}