Skip to content

Commit 08645d5

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #19746
1 parent 4f7e6da commit 08645d5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main/streams.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,8 @@ PHPAPI char *_php_stream_gets(php_stream *stream, char *buf, size_t maxlen TSRML
711711
size_t toread = maxlen - 1;
712712
if (toread > stream->chunk_size)
713713
toread = stream->chunk_size;
714+
else if (toread < stream->chunk_size)
715+
stream->chunk_size = toread;
714716

715717
/* XXX: Should not the loop end, if the stream op fails? */
716718
php_stream_fill_read_buffer(stream, toread TSRMLS_CC);

0 commit comments

Comments
 (0)