Skip to content

Commit

Permalink
Fixed bug #72505 (readfile() mangles files larger than 2G)
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Jun 28, 2016
1 parent ad32c7b commit c73a2f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ PHP NEWS
. Fixed bug #72463 (mail fails with invalid argument). (Anatol)

- Standard:
. Fixed bug #72505 (readfile() mangles files larger than 2G). (Cschneid)
. Fixed bug #72306 (Heap overflow through proc_open and $env parameter).
(Laruence)

Expand Down
2 changes: 1 addition & 1 deletion main/streams/streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_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);
Expand Down

0 comments on commit c73a2f7

Please sign in to comment.