diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-09-22 16:02:01 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-12-08 11:47:49 +0100 |
commit | 65f5573bc82108bbaf2727ffa11575f3292d736f (patch) | |
tree | 6dc2ff7610878ca2d1518d33da67e73ee6951af1 /ext/standard/php_fopen_wrapper.c | |
parent | bd093ad8615267ae4ff1a237e6285dc182a9ff57 (diff) | |
download | php-git-65f5573bc82108bbaf2727ffa11575f3292d736f.tar.gz |
Fix #77069: stream filter loses final block of data
Reading from a stream may return greater than zero, but nonetheless the
stream's EOF flag may have been set. We have to cater to this
condition by setting the close flag for filters.
We also have to cater to that change in the zlib.inflate filter:
If `inflate()` is called with flush mode `Z_FINISH`, but the output
buffer is not large enough to inflate all available data, it fails with
`Z_BUF_ERROR`. However, `Z_BUF_ERROR` is not fatal; in fact, the zlib
manual states: "If deflate returns with Z_OK or Z_BUF_ERROR, this
function must be called again with Z_FINISH and more output space
(updated avail_out) but no more input data, until it returns with
Z_STREAM_END or an error." Hence, we do so.
Closes GH-6001.
Diffstat (limited to 'ext/standard/php_fopen_wrapper.c')
0 files changed, 0 insertions, 0 deletions