-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix GH-13891: memleak and segfault when using ini_set with session.trans_sid_hosts #13892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c248081
Fix GH-13891: memleak and segfault when using ini_set with session.tr…
ndossche cce8ccb
Update ext/standard/url_scanner_ex.re
ndossche 0316664
Further review comment fixes
ndossche c6f3138
Add it also in the ini section for better reproducibility
ndossche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Fix GH-13891: memleak and segfault when using ini_set with session.tr…
…ans_sid_hosts The hash tables used are allocated via the persistent allocator. When using ini_set, the allocation happens via the non-persistent allocator. When the table is then freed in GSHUTDOWN, we get a crash because the allocators are mismatched. As a side note, it is strange that this is designed this way, because it means that ini_sets persist between requests... Test credits go to Kamil Tekiela.
- Loading branch information
commit c248081601d91beb11c3312ba1b6c3ea36e03e51
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --TEST-- | ||
| GH-13891 (memleak and segfault when using ini_set with session.trans_sid_hosts) | ||
| --INI-- | ||
| session.use_cookies=0 | ||
| session.use_only_cookies=0 | ||
| session.use_trans_sid=1 | ||
| --EXTENSIONS-- | ||
| session | ||
| --SKIPIF-- | ||
| <?php include('skipif.inc'); ?> | ||
| --FILE-- | ||
| <?php | ||
| // We *must* set it here because the bug only triggers on a runtime edit | ||
| ini_set('session.trans_sid_hosts','php.net'); | ||
| session_id('sessionidhere'); | ||
| session_start(); | ||
| ?> | ||
| <p><a href="index.php">Click This Anchor Tag!</a></p> | ||
| <p><a href="index.php#place">External link with anchor</a></p> | ||
| <p><a href="http://php.net#foo">External link with anchor 2</a></p> | ||
| <p><a href="#place">Internal link</a></p> | ||
| --EXPECT-- | ||
| <p><a href="index.php?PHPSESSID=sessionidhere">Click This Anchor Tag!</a></p> | ||
| <p><a href="index.php?PHPSESSID=sessionidhere#place">External link with anchor</a></p> | ||
| <p><a href="http://php.net?PHPSESSID=sessionidhere#foo">External link with anchor 2</a></p> | ||
| <p><a href="#place">Internal link</a></p> | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.