diff options
author | Michael Wallner <mike@php.net> | 2014-04-02 15:37:50 +0200 |
---|---|---|
committer | Michael Wallner <mike@php.net> | 2014-04-02 15:37:50 +0200 |
commit | f453917f6210fdef7187fdd7688784e9664b9775 (patch) | |
tree | 47bf7f5e05eef9abfd0a71d4a90b53e79b911050 /main | |
parent | 68556f33847ea45ea0c9205b04094de27037b89b (diff) | |
parent | 1ec83d44a1601c3560f430e08af9698bf8fb075c (diff) | |
download | php-git-f453917f6210fdef7187fdd7688784e9664b9775.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
Fixed bug #61019 (Out of memory on command stream_get_contents)
Diffstat (limited to 'main')
-rw-r--r-- | main/streams/streams.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c index c17570bbeb..5f467ea6ef 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -731,6 +731,10 @@ PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS if (!stream->readfilters.head && (stream->flags & PHP_STREAM_FLAG_NO_BUFFER || stream->chunk_size == 1)) { toread = stream->ops->read(stream, buf, size TSRMLS_CC); + if (toread == (size_t) -1) { + /* e.g. underlying read(2) returned -1 */ + break; + } } else { php_stream_fill_read_buffer(stream, size TSRMLS_CC); |