Skip to content

Fix GH-23741: Reset PDO DBLIB callback userdata - #23746

Closed
prateekbhujel wants to merge 1 commit into
php:PHP-8.4from
prateekbhujel:prateek/fix-gh23741-pdo-dblib-stale-userdata
Closed

prateekbhujel wants to merge 1 commit into
php:PHP-8.4from
prateekbhujel:prateek/fix-gh23741-pdo-dblib-stale-userdata

Conversation

@prateekbhujel

@prateekbhujel prateekbhujel commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

When a PDO DBLIB statement is destroyed, DB-Library can retain its callback userdata pointer to the statement error state. A later callback during connection shutdown can then access freed memory after a failed query.

Reset the userdata to the connection error state before freeing the statement state.

Fixes #23741

@SakiTakamachi

Copy link
Copy Markdown
Member

Sorry for the late reply.

From a safety perspective, I’ve decided to go with #23751 instead.
I’m closing this PR as a duplicate.

@prateekbhujel
prateekbhujel deleted the prateek/fix-gh23741-pdo-dblib-stale-userdata branch September 30, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants