[php-src] PR #25011: Fix GH-25009: GetConsoleTitleW() buffer size passed in bytes
| From: | lazerg | Date: | Wed, 28 Oct 2026 16:41:16 +0000 |
| Subject: | [php-src] PR #25011: Fix GH-25009: GetConsoleTitleW() buffer size passed in bytes | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40027@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25011
Author: lazerg
get_ps_title() passed sizeof(ps_buffer_w) to
GetConsoleTitleW(), but nSize is a count of characters, not bytes. That
told the API the 260-wchar_t buffer could hold 520 characters, so a console title of
260 or more characters set by another process overflowed the stack buffer. This passes
MAX_PATH, the buffer's real length, so long titles get truncated instead.
No test, since it needs a console title longer than PHP itself allows to set, which another process
has to set on the same console.
Fixes #25009