[php-src] PR #11606: Fix GH-10562: Memory leak and invalid state with consecutive ftp_nb_fget
| From: | nielsdos | Date: | Thu, 06 Jul 2023 19:24:26 +0000 |
| Subject: | [php-src] PR #11606: Fix GH-10562: Memory leak and invalid state with consecutive ftp_nb_fget | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-22910@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/11606
Author: nielsdos
When the user does not fully consume the data stream, but instead opens a new one, a memory leak
occurs. Moreover, the state is invalid: when more commands arrive they'll be handled
out-of-sync because the state of the client does not match what the server is doing. This leads to
all sorts of weirdness, for example:
Warning: ftp_nb_fget(): OK.
Fix it by gracefully closing the old data stream when a new data stream is started.