Skip to content

ext/pdo: Reject NUL bytes in parameterized SQL - #417

Open
iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-ip8-pdo-parser-84
Open

iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-ip8-pdo-parser-84

Conversation

@iliaal

@iliaal iliaal commented Sep 25, 2026

Copy link
Copy Markdown
Owner

The PDO placeholder parser accepts bytes after an embedded NUL, while ODBC executes only the prefix through SQLPrepare(SQL_NTS). Reject NUL-containing queries before rewriting parameters so PDO and the driver use the same SQL text.

PDO accepts SQL strings containing NUL, but C-string database APIs stop at
the first NUL. Reject the query before placeholder scanning so a suffix
cannot be silently ignored.
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