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 if a driver describer failed after a successful rowset advance, nextRowset() still returned true while columns[] was left partially initialized and later fetches or getColumnMeta() would touch incomplete column state; this is a code-inspection-level latent defect with no runtime-reproducible case among bundled drivers, hence no test. The fix checks the describe result and returns false from nextRowset(), matching every other call site of pdo_stmt_describe_columns() (pdo_stmt_do_execute(), pdo_stmt_do_fetch(), PDO::prepare()) which already check it; 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