[php-src] PR #22675: Fix GH-22665: pdo_odbc OOB write on oversized diagnostic length
| From: | iliaal | Date: | Fri, 10 Jul 2026 13:36:01 +0000 |
| Subject: | [php-src] PR #22675: Fix GH-22665: pdo_odbc OOB write on oversized diagnostic length | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36953@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22675
Author: iliaal
pdo_odbc_error() NUL-terminates the diagnostic buffer at the length SQLGetDiagRec reports, which on
a truncated message is the full untruncated length and can reach or exceed the 512-byte last_err_msg
buffer, writing the terminator out of bounds into the adjacent last_error field. Clamps the index to
sizeof-1; the size_t cast also covers a negative driver-reported length. Reproduces with the SQLite3
ODBC driver (reports 512) via a failing query whose long identifier lengthens the message; the test
skips without that driver.
Fixes #22665