Skip to content

SAPI: clear current_user and content_type_dup after releasing them - #209

Closed
iliaal wants to merge 1 commit into
PHP-8.4from
fix/sapi-clear-released-request-info
Closed

SAPI: clear current_user and content_type_dup after releasing them#209
iliaal wants to merge 1 commit into
PHP-8.4from
fix/sapi-clear-released-request-info

Conversation

@iliaal

@iliaal iliaal commented Jul 31, 2026

Copy link
Copy Markdown
Owner

sapi_deactivate_module() frees current_user and content_type_dup but leaves both pointers set, unlike auth_user, auth_password and auth_digest right above them. Nothing reads either field between the free and the next sapi_activate(), so this is consistency rather than a live bug, and a second deactivate would double-free.

This is older than the zend_string conversion in php#22902, so it targets 8.4.

sapi_deactivate_module() frees both without resetting the pointer, unlike
the auth_user, auth_password and auth_digest fields next to them. Nothing
reads them between the free and the next sapi_activate() today, so this is
consistency rather than a live bug.

Closes phpGH-22974
@iliaal
iliaal force-pushed the fix/sapi-clear-released-request-info branch from f8ff8f2 to 063c6b7 Compare July 31, 2026 14:44
@iliaal

iliaal commented Jul 31, 2026

Copy link
Copy Markdown
Owner Author

Promoted upstream as php#22974.

@iliaal iliaal closed this Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant