summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli_server.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2021-01-26 17:46:32 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2021-02-03 11:22:37 +0100
commit1bb2a4f91cfde36ba343184f3d88189e646cc363 (patch)
treed234e4ac8965445653a6c29ea2615f92dbeada8d /sapi/cli/php_cli_server.c
parent3d09626f0d3f43494352f9c5d9a6b6a0a91515ef (diff)
downloadphp-git-1bb2a4f91cfde36ba343184f3d88189e646cc363.tar.gz
Fix #53467: Phar cannot compress large archives
When Phars are flushed, a new temporary file is created for each entry which should be compressed, and the `compressed_filesize` is retrieved. Afterwards, the Phar manifest is written, and only after that the files are copied to the actual Phar. So for each such entry there is an open temp file, what easily exceeds the limit. Therefore, we use a single temporary file for all entries, and store the start offset in the otherwise unused `header_offset` member. We ensure that the `cfp` members are properly set to NULL even if flushing fails, to avoid use after free scenarios. This solution is based on a suggestion by @lserni[1]. Closes GH-6643. [1] <https://github.com/box-project/box2/issues/80#issuecomment-77147371>
Diffstat (limited to 'sapi/cli/php_cli_server.c')
0 files changed, 0 insertions, 0 deletions