Skip to content

[PDO] Fail nextRowset() when pdo_stmt_describe_columns() fails - #284

Open
iliaal wants to merge 1 commit into
PHP-8.4from
fix/pdo-nextrowset-describe-fail-84
Open

[PDO] Fail nextRowset() when pdo_stmt_describe_columns() fails#284
iliaal wants to merge 1 commit into
PHP-8.4from
fix/pdo-nextrowset-describe-fail-84

Conversation

@iliaal

@iliaal iliaal commented Aug 24, 2026

Copy link
Copy Markdown
Owner

pdo_stmt_do_next_rowset() ignored the return value of pdo_stmt_describe_columns(), so a describer failure after a successful rowset advance left columns[] partially initialized while nextRowset() still returned true and later fetches or getColumnMeta() read incomplete column state. nextRowset() now checks the describe result and returns false on failure, as pdo_stmt_do_execute(), pdo_stmt_do_fetch() and PDO::prepare() already do at their call sites. No bundled driver reaches that condition, so there is no test; a sibling audit found no other unchecked call.

pdo_stmt_do_next_rowset() ignored the return value of
pdo_stmt_describe_columns(), so a driver describer failure after a
successful rowset advance left partially initialized columns[] while
nextRowset() still returned true; subsequent fetches would then touch
incomplete column state. The result is now checked and the method
returns false on failure, consistent with all other call sites
(pdo_stmt_do_execute(), pdo_stmt_do_fetch(), PDO::prepare()) which
already check it. No runtime reproducible case exists among bundled
drivers, hence no test.
@iliaal iliaal closed this Aug 24, 2026
@iliaal iliaal reopened this Aug 24, 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