[php-src] PR #15855: Fix zend_get_property_info_for_slot() for lazy objects
| From: | arnaud-lb | Date: | Thu, 12 Sep 2024 12:32:05 +0000 |
| Subject: | [php-src] PR #15855: Fix zend_get_property_info_for_slot() for lazy objects | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-28556@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/15855
Author: arnaud-lb
zend_get_property_info_for_slot(obj, slot) assumes that 'slot' belongs to 'obj',
but that may not be the case for lazy proxies.
Fortunatley, the property info is often already available in path when it is nedded.
For other cases, I make zend_get_property_info_for_slot() aware of lazy objects, and add
zend_get_property_info_for_slot_self() for cases where the 'slot' is known to belong to
the object itself.
Fixes oss-fuzz #71446
zend_get_property_info_for_slot() is used in the engine for variable property accesses such as
$obj->$prop. I retrieve the property info by inspecting the cache_slot, as it's
set by the read_property or get_property_ptr_ptr handlers. An alternative would be to add a
zend_property_info ** parameter to these handlers.