]> granicus.if.org Git - php/commitdiff
MFH: do not try to read after EOF
authorAntony Dovgal <tony2001@php.net>
Wed, 6 Apr 2005 08:26:44 +0000 (08:26 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 6 Apr 2005 08:26:44 +0000 (08:26 +0000)
main/streams/streams.c

index 01541a67ef8a2183f3df972983e93673d7668a5f..f3154ccaa60df4958052f1426f809f36663ae229 100755 (executable)
@@ -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 {