[pull] master from php:master#1033
Merged
Merged
Conversation
…22453) Fix #22449, a NULL pointer dereference in `user_filter_factory_create()` POC: ```php <?php try { stream_filter_register("rotator_notWorking", rotate_filter_nw::class); class rotate_filter_nw extends php_user_filter { function filter($in, $out, &$consumed, $closing): int { $stream = fopen('php://memory', 'w+'); stream_filter_append($stream, "rotator_notWorking"); } } $stream = fopen('php://memory', 'w+'); stream_filter_append($stream, "rotator_notWorking"); } catch (\Throwable $_ffl_e) {} ``` Resulted in this output: ``` /home/fuzz/WorkSpace/fusion-fuzz/projects/php/php-src/Zend/zend_hash.c:55:7: runtime error: member access within null pointer of type 'const HashTable' (aka 'const struct _zend_array') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/fuzz/WorkSpace/fusion-fuzz/projects/php/php-src/Zend/zend_hash.c:55:7 in ```
Follow up of dc34d34
This will make it both easier to consume the error information and reduce the chance for mistakes when settings errors, because not every field will need to be set manually. The functions that have been removed as part of this change were added in master only, thus removing those is not an API change between the latest stable (PHP 8.5) and this PR. Fixes #22420.
Addressing a few late review comments
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 : )