[php-src] PR #23594: iconv: keep working converter when stream filter seek reset fails
| From: | iliaal | Date: | Sun, 06 Sep 2026 15:07:30 +0000 |
| Subject: | [php-src] PR #23594: iconv: keep working converter when stream filter seek reset fails | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38344@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23594
Author: iliaal
php_iconv_stream_filter_seek() closed the filter's converter before knowing
whether a replacement could be opened, then assigned the failed iconv_open() result.
That left self->cd as (iconv_t)-1 for every subsequent read and write, and the filter dtor then
called iconv_close() on it. Opening the replacement first and swapping it in only on success keeps
the working converter on failure.
No test: the charsets are fixed when the filter is created and already validated by the iconv_open()
there, so a second open of the same pair can only fail on OOM. There is no userland input that
reaches the branch.