summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2016-06-28 11:11:25 +0800
committerXinchen Hui <laruence@gmail.com>2016-09-16 20:53:51 +0800
commitac07008bb7eeee46c9e45c976fc3dc264f0eadff (patch)
tree46afcd33e69889705406c391bbfd8fddcfe77065
parent46df0642618eabc5b5b7df490d1ae23bda00a745 (diff)
downloadphp-git-ac07008bb7eeee46c9e45c976fc3dc264f0eadff.tar.gz
Fixed bug #72505 (readfile() mangles files larger than 2G)
-rw-r--r--main/streams/streams.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c
index f8581336bd..4e00cd1be3 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);