History log of /php-src/ext/zend_test/tests/gh10370_4.phpt (Results 1 – 2 of 2)
Revision Date Author Comments
# 10f23785 10-Feb-2023 Arnaud Le Blanc

Fix concurrent testing


# b4db690c 10-Feb-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-10370: File corruption in _php_stream_copy_to_stream_ex when using copy_file_range (#10440)

copy_file_range can return early without copying all the data. This is
legal behaviour

Fix GH-10370: File corruption in _php_stream_copy_to_stream_ex when using copy_file_range (#10440)

copy_file_range can return early without copying all the data. This is
legal behaviour and worked properly, unless the mmap fallback was used.
The mmap fallback would read too much data into the destination,
corrupting the destination file. Furthermore, if the mmap fallback would
fail and have to fallback to the regular file copying mechanism, a
similar issue would occur because both maxlen and haveread are modified.
Furthermore, there was a mmap-resource in one of the failure paths of
the mmap fallback code.
This patch fixes these issues. This also adds regression tests using the
new copy_file_range early-return simulation added in the previous
commit.

show more ...