diff options
| author | Arnaud Le Blanc <lbarnaud@php.net> | 2008-11-11 01:55:19 +0000 |
|---|---|---|
| committer | Arnaud Le Blanc <lbarnaud@php.net> | 2008-11-11 01:55:19 +0000 |
| commit | fc938b54c779985fb55de830c6faaf932c90797c (patch) | |
| tree | 42f5e397f5f15410cc074e47de652db99e7b0f37 /main/streams/streams.c | |
| parent | 3358613c4b771f94299681ae66fe1ad175941c4b (diff) | |
| download | php-git-fc938b54c779985fb55de830c6faaf932c90797c.tar.gz | |
Fixed stream_get_contents() when using $maxlength and socket is not
closed. indeyets@php.net on #46049.
Diffstat (limited to 'main/streams/streams.c')
| -rwxr-xr-x | main/streams/streams.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |
