Skip to content

ext/openssl: Propagate session_get_cb exceptions unchanged - #458

Closed
iliaal wants to merge 1 commit into
PHP-8.6from
fix/openssl-session-get-cb-exception
Closed

iliaal wants to merge 1 commit into
PHP-8.6from
fix/openssl-session-get-cb-exception

Conversation

@iliaal

@iliaal iliaal commented Nov 5, 2026

Copy link
Copy Markdown
Owner

An exception thrown by session_get_cb left the call's return value undefined, and the return type check reported it as a TypeError chained over the user's exception. Skip the check for an undefined value, as the PSK callbacks already do, so the original exception reaches the caller.

Found in a large-scope review of the 8.6 session resumption callbacks. The new test fails on an unpatched PHP-8.6 ASAN build with the chained TypeError in both the Error and Exception stream error modes, and passes with the patch.

An exception thrown by session_get_cb left the call's return value
undefined, which the return type check then reported as a TypeError
chained over the user's exception. Skip that check for an undefined
return value, as the PSK callbacks already do, so the original exception
reaches the caller.
@iliaal

iliaal commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Submitted upstream as php#25218.

@iliaal iliaal closed this Nov 5, 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