[session] Close save handler when session_regenerate_id create fails - #303
Open
iliaal wants to merge 1 commit into
Open
[session] Close save handler when session_regenerate_id create fails#303iliaal wants to merge 1 commit into
iliaal wants to merge 1 commit into
Conversation
After the successful s_close()/s_open() pair, a failing s_create_sid() reset the status and threw without closing the freshly opened handler, leaving mod_data open until request shutdown and double-opening it on the next start; the collision-retry failure path in the same function already closes. Mirror that close on the null-id path. Sibling audit: session_create_id() breaks out to its own error path, mod_mm's strict re-create returns FAILURE into the initialize abort path, and the strict-mode re-create branch of php_session_initialize() now aborts via the preceding commit.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
php_session_regenerate_id() opened the save handler via s_open() and then threw when s_create_sid() failed, leaving mod_data open until request shutdown and double-opening it on the next session start; the collision-retry loop in the same function already closes the handler on its failure. This closes it on the null-id path too. Split out of staging PR 286 so each PR carries a single fix.