Skip to content

ext/pdo_dblib: Match error allocation to handle persistence - #357

Closed
iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-pdo-dblib-persistent-error-allocator-uaf-yb81-84-work
Closed

iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-pdo-dblib-persistent-error-allocator-uaf-yb81-84-work

Conversation

@iliaal

@iliaal iliaal commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Track persistence on embedded DB-Library error state so callback strings and cleanup use request or persistent allocators consistently across handle lifetimes.

The DB-Lib error and message handlers estrdup() server and library text
into the connection's pdo_dblib_err. For a persistent connection, errors
raised through PDO::exec() and the transaction and lastInsertId() calls
stay there until the next statement execute, so a request that ends after
such an error leaves pointers into the reset request heap. The next
request efree()s them from the message or error handler or the cursor
closer, and module shutdown does from the handle closer. Free them from
persistent_shutdown once the last PDO object using the connection is
released.
@iliaal
iliaal force-pushed the fix/aph-pdo-dblib-persistent-error-allocator-uaf-yb81-84-work branch from 7e3fe57 to 462b52f Compare November 2, 2026 14:01
@iliaal

iliaal commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Promoted upstream: php#25159

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