[php-src] PR #22203: bound host copy to its length in php_fopen_do_pasv
| From: | alhudz | Date: | Mon, 01 Jun 2026 19:40:46 +0000 |
| Subject: | [php-src] PR #22203: bound host copy to its length in php_fopen_do_pasv | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36270@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22203
Author: alhudz
php_fopen_do_pasv at ftp_fopen_wrapper.c:364 copies the host with a fixed ip_size from hoststart,
which points into the 512-byte tmp_line holding the server's untrusted 227 reply, so a long
message before the address tuple drives the read past the end of the buffer. Copy only the
NUL-terminated host length instead, capped to ip_size-1.