Skip to content

Fix GH-24609: mysqlnd OK packets without info rejected on x32 builds - #24614

Merged
kamil-tekiela merged 2 commits into
php:PHP-8.4from
lazerg:fix/gh-24609
Oct 29, 2026
Merged

kamil-tekiela merged 2 commits into
php:PHP-8.4from
lazerg:fix/gh-24609

Conversation

@lazerg

@lazerg lazerg commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

php_mysqlnd_rset_header_read() stored the zend_ulong from php_mysqlnd_net_field_length() in a size_t. On x32 that is 32 bits, so MYSQLND_INVALID_NET_FIELD_LENGTH was truncated and a minimal OK packet was rejected as an over-read. Making the variable a zend_ulong fixes it.

Fixes GH-24609

@kamil-tekiela

Copy link
Copy Markdown
Member

Can this not be tested with a real server?

@lazerg

lazerg commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

A real server does hit this path (any plain OK reply, like an INSERT), so existing mysqli tests already cover it and would fail on an x32 build. But on 64-bit they pass with or without the fix, so I can't make a real-server test that fails before the fix. The fake server just lets me pin the exact packet.

@kamil-tekiela

Copy link
Copy Markdown
Member

So we don't need any new test. The problem wasn't a missing test, but not running it under that specific setup.

@kamil-tekiela
kamil-tekiela merged commit b6cf47f into php:PHP-8.4 Oct 29, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants