From fc938b54c779985fb55de830c6faaf932c90797c Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Tue, 11 Nov 2008 01:55:19 +0000 Subject: Fixed stream_get_contents() when using $maxlength and socket is not closed. indeyets@php.net on #46049. --- main/streams/streams.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main') diff --git a/main/streams/streams.c b/main/streams/streams.c index 6f9a4eef1b..ba2f65c5d3 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1672,7 +1672,7 @@ PHPAPI size_t _php_stream_copy_to_mem_ex(php_stream *src, zend_uchar rettype, vo if (maxlen > 0) { if (rettype == IS_UNICODE) { ptr.u = *buf = pemalloc_rel_orig(UBYTES(maxlen + 1), persistent); - while ((len < maxlen) & !php_stream_eof(src)) { + while ((len < maxlen) && !php_stream_eof(src)) { int ulen; ret = php_stream_read_unicode_ex(src, ptr.u, maxlen - len, maxchars); @@ -1685,7 +1685,7 @@ PHPAPI size_t _php_stream_copy_to_mem_ex(php_stream *src, zend_uchar rettype, vo return len; } else { ptr.s = *buf = pemalloc_rel_orig(maxlen + 1, persistent); - while ((len < maxlen) & !php_stream_eof(src)) { + while ((len < maxlen) && !php_stream_eof(src)) { ret = php_stream_read(src, ptr.s, maxlen - len); len += ret; ptr.s += ret; -- cgit v1.2.1