Re: cvs: php-src /main/streams streams.c
| From: | Ilia Alshanetsky | Date: | Wed, 06 Apr 2005 14:06:43 +0000 |
| Subject: | Re: cvs: php-src /main/streams streams.c | ||
| References: | 1 2 3 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-31260@lists.php.net to get a copy of this message | ||
I checked the code with valgrind and it seems to me like the problem lies else where. According to valgrind (at some point, probably the last line) we have a Conditional jump or move depends on uninitialised value(s) php_stream_get_record (/php5/main/streams/streams.c:847)
Ilia
Antony Dovgal wrote:
On Wed, 6 Apr 2005 09:05:35 -0400 Wez Furlong <kingwez@gmail.com> wrote:What problem does this fix? EOF can be a temporary condition for network streams, depending on non-blocking status, and the read call is used to re-enable it. (yay for backward compatibility).stream_get_line() gives a lot of garbage trying to read after EOF and segfaults with this code: <? $fp = fopen(dirname(__FILE__)."/test.txt", 'r'); while ($data = stream_get_line($fp, 100, "|")) {var_dump($data);} ?> test.txt contents: ------- line1 | some | another -------