[GIT-PULLS] [php-src] PR #23045: Fix GH-23016: pdo_odbc returns garbage for NULL long columns
[email protected] (iliaal)
| Newsgroups | php.git-pulls |
|---|---|
| Message-ID | <fqG5MKqWZif8lIpfbiYeqgHWLUhUC4kbxAKm6wHdzJ0@main.internal.php.net> |
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