[php-src] PR #22674: Fix GH-22666: pdo_odbc heap overflow on oversized output param
| From: | iliaal | Date: | Fri, 10 Jul 2026 13:35:53 +0000 |
| Subject: | [php-src] PR #22674: Fix GH-22666: pdo_odbc heap overflow on oversized output param | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36952@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22674
Author: iliaal
ext/pdo_odbc sizes an output-param buffer from the declared maxlen but copies the runtime value in
by its own length (heap write overflow) and reads it back by the driver-reported length, which on a
truncated OUTPUT value exceeds the buffer (01004 over-read). Records the bound capacity and clamps
both the input copy and the read-back to it. Over-long values are bounded to maxlen, which is all
the driver round-trips anyway since the buffer is bound at maxlen before the value is known.
Reproduces with the SQLite3 ODBC driver; the test skips without it.
Fixes #22666