From: Antony Dovgal Date: Wed, 6 Apr 2005 08:26:44 +0000 (+0000) Subject: MFH: do not try to read after EOF X-Git-Tag: php-5.0.5RC1~479 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dfaf49e9fd502fee6f9a75f32e33ac2dfe539a09;p=php MFH: do not try to read after EOF --- diff --git a/main/streams/streams.c b/main/streams/streams.c index 01541a67ef..f3154ccaa6 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -836,6 +836,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 {