[pull] master from php:master#1047
Merged
Merged
Conversation
php_json_encode_serializable_object() holds a raw pointer to the object across the jsonSerialize() call, then reads its recursion guard and compares the returned value's identity against it. A user error handler triggered from jsonSerialize() can drop the last reference to the object, for example by nulling a reference that aliases the encoded array slot, freeing it before those reads and causing a use-after-free. Hold a reference on the object across the call. The array path already guards against this with a ZVAL_COPY; the JsonSerializable object path did not. Same use-after-free class as GH-21024 in var_dump().
XXH3_state_t requires 64-byte alignment for its acc, customSecret, and buffer members, but php_hash_alloc_context() used ecalloc(), which only guarantees alignof(max_align_t) (typically 16 bytes on x86_64). When heap layout broke that assumption, xxhash's aligned loads segfaulted. Add a context_align field to php_hash_ops; when set, php_hash_alloc_context() over-allocates and manually aligns the returned pointer, storing the offset for php_hash_free_context() to recover the original allocation. Fixes GH-18173 Closes GH-21668
* PHP-8.4: Fix GH-18173: ext/hash relies on implementation-defined malloc alignment
* PHP-8.5: Fix GH-18173: ext/hash relies on implementation-defined malloc alignment
IntlChar methods could leave stale global intl error state after a later successful call. Reset the intl error state when entering each IntlChar method so successful calls report U_ZERO_ERROR. Closes #22500
* PHP-8.4: ext/intl: Reset IntlChar error state on method entry (#22500)
* PHP-8.5: ext/intl: Reset IntlChar error state on method entry (#22500)
…ket_recvfrom. Take a new approach from PR #17926: instead of parsing ethernet/IP/TCP/UDP headers in C, expose the raw frame as a string to userland, letting users handle protocol decoding safely in PHP. This addresses the security concerns raised during review. Also rename opaque argument variables (arg1..arg6) to meaningful names in both functions and fix a bug in the commented-out sendto code that was using &sin instead of &sll. close GH-21631
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 : )