Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault in Zend/zend_types.h #15906

Open
YuanchengJiang opened this issue Sep 16, 2024 · 1 comment
Open

Segmentation fault in Zend/zend_types.h #15906

YuanchengJiang opened this issue Sep 16, 2024 · 1 comment

Comments

@YuanchengJiang
Copy link

Description

The following code:

<?php
class Test {
private $prop {
set { echo __METHOD__, "\n"; }
}
}
$test = new Test;
$fusion = $test;
foreach($fusion as $value) {
}

Resulted in this output:

/php-src/Zend/zend_types.h:650:13: runtime error: member access within null pointer of type 'const zval' (aka 'const struct _zval_struct')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/Zend/zend_types.h:650:13

https://3v4l.org/BMg1A/rfc#vgit.master

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

@cmb69
Copy link
Member

cmb69 commented Sep 16, 2024

zval *property = zend_hash_get_current_data(properties);
if (Z_TYPE_P(property) == IS_PTR) {

I think we need to handle zend_hash_get_current_data(properties) returning NULL here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants