[php-src] Issue #14808: Unexpected null pointer in Zend/zend_string.h
| From: | YuanchengJiang | Date: | Thu, 04 Jul 2024 04:01:22 +0000 |
| Subject: | [php-src] Issue #14808: Unexpected null pointer in Zend/zend_string.h | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247223@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/14808
Author: YuanchengJiang
### Description
The following code:
```php
<?php
var_dump($args);
ob_start('ob_iconv_handler');
ob_clean();
$args = [];
$reflection = new ReflectionFunction('ob_get_contents');
$x = $reflection->invokeArgs($args);
```
Resulted in this output:
```
/php-src/Zend/zend_string.h:200:24: runtime error: null pointer passed as argument 2, which is
declared to never be null
/usr/include/string.h:44:28: note: nonnull attribute specified here (memcpy)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/Zend/zend_string.h:200:24
```
### PHP Version
PHP 8.4.0-dev
### Operating System
ubuntu 22.04