diff -up php-5.2.17/main/streams/streams.c.bug-60455 php-5.2.17/main/streams/streams.c --- php-5.2.17/main/streams/streams.c.bug-60455 2012-01-12 11:50:11.000000000 +0700 +++ php-5.2.17/main/streams/streams.c 2012-01-12 11:50:55.000000000 +0700 @@ -879,7 +879,7 @@ PHPAPI char *php_stream_get_record(php_s just_read = (stream->writepos - stream->readpos) - len; len += just_read; - if (just_read < toread) { + if (just_read == 0) { break; } }