Skip to content

ext/pdo: Fix use-after-free when PDO::ATTR_STATEMENT_CLASS replaces the constructor arguments - #25806

Open
Roman3349 wants to merge 1 commit into
php:PHP-8.4from
Roman3349:fix/pdo-statement-class-release-order
Open

Roman3349 wants to merge 1 commit into
php:PHP-8.4from
Roman3349:fix/pdo-statement-class-release-order

Conversation

@Roman3349

Copy link
Copy Markdown
Contributor

pdo_dbh_attribute_set() released the old constructor arguments before storing the new ones, so a destructor of an old argument that read the attribute saw the array being destroyed. Store the new arguments first.

…e old ones

Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
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.

1 participant