]> granicus.if.org Git - php/commit
Fix #76859 stream_get_line skips data if used with data-generating filter
authorKonstantin Kopachev <tenzzor@gmail.com>
Tue, 18 Sep 2018 04:44:01 +0000 (21:44 -0700)
committerJoe Watkins <krakjoe@php.net>
Thu, 3 Oct 2019 04:50:43 +0000 (06:50 +0200)
commit05560b67bc87a2bcbfd5b48a48443a62f3311e7d
treeeda0a78887a15d6a8e6c6852ea0d6d7572f8430c
parentf2fb37a772908a9331e67f583fddcc4b1b186ccf
Fix #76859 stream_get_line skips data if used with data-generating filter

stream_get-line repeatedly calls php_stream_fill_read_buffer until
enough data is accumulated in buffer. However, when stream contains
filters attached to it, then each call to fill buffer essentially
resets buffer read/write pointers and new data is written over old.
This causes stream_get_line to skip parts of data from stream
This patch fixes such behavior, so fill buffer call will append.
NEWS
ext/standard/tests/streams/bug46147.phpt [new file with mode: 0644]
ext/standard/tests/streams/bug76859.phpt [new file with mode: 0644]
main/streams/filter.c
main/streams/streams.c