[php-src] Issue #12721: SplFileInfo::getFilename() segfault in combination with GlobIterator and file containing Chinese letters
| From: | gafnex | Date: | Sat, 18 Nov 2023 22:24:25 +0000 |
| Subject: | [php-src] Issue #12721: SplFileInfo::getFilename() segfault in combination with GlobIterator and file containing Chinese letters | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245838@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12721
Author: gafnex
### Description
The following code:
```php
<?php
$contents = '英文看不懂咋办?';
file_put_contents('file1.txt', $contents);
foreach (new GlobIterator('file1.txt') as $fileInfo) {
echo $fileInfo->getFilename();
}
```
Resulted in this output:
*segfault*
But I expected this output instead:
```
file1.txt
```
### PHP Version
PHP 8.2.12
### Operating System
_No response_