[php-src] Issue #15833: Segmentation fault (access null pointer) in ext/spl/spl_array.c
| From: | YuanchengJiang | Date: | Wed, 11 Sep 2024 03:34:25 +0000 |
| Subject: | [php-src] Issue #15833: Segmentation fault (access null pointer) in ext/spl/spl_array.c | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247749@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/15833
Author: YuanchengJiang
### Description
The following code:
```php
<?php
class C {
public int $a;
}
$reflector = new ReflectionClass(C::class);
$obj = $reflector->newLazyProxy(function ($obj) {
$obj = new C();
return $obj;
});
$fusion = $obj;
$recursiveArrayIterator = new RecursiveArrayIterator($fusion);
$test = new RecursiveIteratorIterator($recursiveArrayIterator);
var_dump($test->current());
```
Resulted in this output:
```
/php-src/ext/spl/spl_array.c:79:7: runtime error: member access within null pointer of type
'HashTable' (aka 'struct _zend_array')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/ext/spl/spl_array.c:79:7
```
### PHP Version
PHP 8.4.0-dev
### Operating System
ubuntu 22.04