From ac07008bb7eeee46c9e45c976fc3dc264f0eadff Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 28 Jun 2016 11:11:25 +0800 Subject: [PATCH] Fixed bug #72505 (readfile() mangles files larger than 2G) --- main/streams/streams.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/streams/streams.c b/main/streams/streams.c index f8581336bd6..4e00cd1be39 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -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);