mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.4'
* PHP-8.4: Fix segfault when assigning to backing value by-ref from hook
This commit is contained in:
22
Zend/tests/oss-fuzz-391975641.phpt
Normal file
22
Zend/tests/oss-fuzz-391975641.phpt
Normal file
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
OSS-Fuzz #391975641: Segfault when creating reference from backing value
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class C {
|
||||
public $prop {
|
||||
get => $this->prop;
|
||||
set {
|
||||
$this->prop = &$value;
|
||||
$value = &$this->prop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C;
|
||||
$c->prop = 1;
|
||||
var_dump($c->prop);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -3492,7 +3492,7 @@ static zend_always_inline void zend_assign_to_property_reference(zval *container
|
||||
|
||||
variable_ptr = zend_wrong_assign_to_variable_reference(
|
||||
variable_ptr, value_ptr, &garbage OPLINE_CC EXECUTE_DATA_CC);
|
||||
} else if (prop_info) {
|
||||
} else if (prop_info && ZEND_TYPE_IS_SET(prop_info->type)) {
|
||||
variable_ptr = zend_assign_to_typed_property_reference(prop_info, variable_ptr, value_ptr, &garbage EXECUTE_DATA_CC);
|
||||
} else {
|
||||
zend_assign_to_variable_reference(variable_ptr, value_ptr, &garbage);
|
||||
|
||||
Reference in New Issue
Block a user