From: Antony Dovgal Date: Wed, 6 Apr 2005 08:26:06 +0000 (+0000) Subject: do not try to read after EOF X-Git-Tag: php-5.0.1b1~600 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7a2efe053a41742b1305ed5e88b158be156e7e8;p=php do not try to read after EOF --- diff --git a/main/streams/streams.c b/main/streams/streams.c index 23b894b2b0..66956a2977 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -847,6 +847,10 @@ PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *re php_stream_fill_read_buffer(stream, maxlen TSRMLS_CC); + if ((stream->writepos - stream->readpos)<=0) { + return NULL; + } + if (delim_len == 0 || !delim) { toread = maxlen; } else {