From: Ilia Alshanetsky Date: Wed, 6 Jan 2010 12:54:53 +0000 (+0000) Subject: Fixed bug #50657 (copy() with an empty (zero-byte) HTTP source succeeds but returns... X-Git-Tag: php-5.2.13RC1~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e781314b0b4e01c22f9be9a2675f2c2c6798dc2;p=php Fixed bug #50657 (copy() with an empty (zero-byte) HTTP source succeeds but returns false). --- diff --git a/NEWS b/NEWS index 379b3fa6f7..9a027705d5 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ PHP NEWS - Fixed build of mysqli with MySQL 5.5.0-m2. (Andrey) +- Fixed bug #50657 (copy() with an empty (zero-byte) HTTP source succeeds but + returns false). (Ilia) - Fixed bug #50636 (MySQLi_Result sets values before calling constructor). (Pierrick) - Fixed bug #50632 (filter_input() does not return default value if the diff --git a/main/streams/streams.c b/main/streams/streams.c index edfd568a0c..92793cdf2b 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1386,7 +1386,7 @@ PHPAPI size_t _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, s /* we've got at least 1 byte to read. * less than 1 is an error */ - if (haveread > 0) { + if (haveread > 0 || src->eof) { return SUCCESS; } return FAILURE;