Skip to content

Unexpected null pointer in Zend/zend_string.h #14808

Description

@YuanchengJiang

Description

The following code:

<?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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions