[php-src] PR #23045: Fix GH-23016: pdo_odbc returns garbage for NULL long columns
| From: | iliaal | Date: | Tue, 04 Aug 2026 18:37:14 +0000 |
| Subject: | [php-src] PR #23045: Fix GH-23016: pdo_odbc returns garbage for NULL long columns | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-37525@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23045
Author: iliaal
LONG_COLUMN_BUFFER_SIZE derives from ZSTR_MAX_OVERHEAD, which is a
size_t, so C->fetched_len < LONG_COLUMN_BUFFER_SIZE was evaluated
unsigned and SQL_NULL_DATA compared as SIZE_MAX. A NULL long column
therefore skipped the early exit to in_data, and seed_len clamped to
LONG_COLUMN_BUFFER_SIZE - 1, seeding the result with uninitialized bytes out of
C->data.
Both comparisons predate 8.5.9. The 8.5 long column rewrite replaced the signed literal
256 with the macro, which is why 8.4 is unaffected; 8.5.9 changed the seed from 0 bytes
to 4064 and turned an empty string into a disclosure.
Fixes #23016