1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 09:12:14 +01:00

Fixed bug #72505 (readfile() mangles files larger than 2G)

This commit is contained in:
Xinchen Hui
2016-06-28 11:11:25 +08:00
parent 46df064261
commit ac07008bb7

View File

@@ -1402,7 +1402,7 @@ PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_DC TSRMLS_DC)
if (p) {
do {
/* output functions return int, so pass in int max */
if (0 < (b = PHPWRITE(p, MIN(mapped - bcount, INT_MAX)))) {
if (0 < (b = PHPWRITE(p + bcount, MIN(mapped - bcount, INT_MAX)))) {
bcount += b;
}
} while (b > 0 && mapped > bcount);