[pull] master from php:master#1106
Merged
Merged
Conversation
php_dechunk() accumulated the hex chunk size with chunk_size * 16 + digit and never checked the multiply, so a size of 2^64 wrapped to 0. A zero size reads as the terminating chunk, so the filter stopped there and dropped the body it had been handed. Error out instead, as the other malformed-size cases already do. Closes GH-22786
* PHP-8.4: ext/standard: reject a dechunk chunk size that overflows size_t
* PHP-8.5: ext/standard: reject a dechunk chunk size that overflows size_t
Instead rely on the mechanism gated by the error_include_args INI to display them. This actually aligns the behaviour of what was accepted in https://wiki.php.net/rfc/display_error_function_args.
This introduces new API for fd copying and modifies php_stream_copy_to_stream_ex to use it. The implementation is separated for various platforms and the end result have couple of implications: - sendfile is used for copying file to generic fd (e.g. sockets) on all platforms except Windows that use TransmitFile - splice is used for copying between generic fds (e.g. sockets) on Linux - copy_file_range should get used on alpine linux with directly using syscall (as musl does not seem to implement it) - copy_file_range is used in the loop so it is used multiple times for files bigger than 2GB on Linux. - file mmap for copying is removed as it allowed crashing PHP when another process modified mapped file - this was used as a fallback for file copying. Sendfile should partially replace it. - File to file copying was optimized on Windows with use of ReadFile and WriteFile. This also adds various tests including Linux unit tests. Closes GH-20399 Co-authored-by: David Carlier <devnexen@gmail.com>
Split API changes into Removed, Changed, and Added
…ing (#22806) Rather than when attempting to create an instance of it within the stream layer.
Use `uint32_t` for values that are really `uint32_t`, like constant module numbers and the result from `zend_hash_num_elements()`. Use `uint32_t` for counting up, when values should never be negative. Adjust format specifiers to use `PRIu32` rather than `%d` for the uint32_t values.
Put the `*` next to the name, rather than the type
Avoid tabs or multiple spaces other than for indentation, remove a leading newline from `ReflectionProperty::hasHook()`
Propagate changes up which means we can also voidify php_init_stream_wrappers() removing an if() check during startup.
This removes a strlen() call when we already know the length of the string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )