[php-src] PR #22349: Fix heap over-read seeding the long-column buffer in pdo_odbc
| From: | iliaal | Date: | Tue, 16 Jun 2026 22:59:12 +0000 |
| Subject: | [php-src] PR #22349: Fix heap over-read seeding the long-column buffer in pdo_odbc | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36477@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22349
Author: iliaal
In the long-column fetch path, when the ODBC driver reports the total column length rather than
SQL_NO_TOTAL, the result string was seeded by copying orig_fetched_len + 1 bytes out of C->data,
which holds at most LONG_COLUMN_BUFFER_SIZE bytes from the first SQLGetData. For a column larger
than that buffer this reads past C->data. Seed only the bytes actually present, matching the
SQL_NO_TOTAL branch; the remainder is still fetched by the loop.