Skip to content

Commit 1918011

Browse files
author
Sascha Schumann
committed
Interrupt loop, if the stream op fails.
1 parent 5e97e66 commit 1918011

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main/streams.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,11 @@ PHPAPI char *_php_stream_gets(php_stream *stream, char *buf, size_t maxlen TSRML
713713
if (toread > stream->chunk_size)
714714
toread = stream->chunk_size;
715715

716-
/* XXX: Should not the loop end, if the stream op fails? */
717716
php_stream_fill_read_buffer(stream, toread TSRMLS_CC);
717+
718+
if (stream->writepos - stream->readpos == 0) {
719+
break;
720+
}
718721
}
719722
}
720723

0 commit comments

Comments
 (0)