[php-src] PR #16331: Fix property access of PHP objects wrapped in variant
| From: | cmb69 | Date: | Wed, 09 Oct 2024 18:52:09 +0000 |
| Subject: | [php-src] PR #16331: Fix property access of PHP objects wrapped in variant | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-29116@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/16331
Author: cmb69
First, we fix the long standing issue that property access throws a
com_exception
("0x80020003: member not found), because the HRESULT was not properly set after
accessing the property.
Next, we fix an issue introduced as of PHP 7.0.0, where the string length for write access had been
properly adapted, but the string length for read access had been overlooked.
Then we fix an issue introduced as of PHP 8.0.0, where new HashTables no longer set
nNextFreeElement to zero, but to ZEND_LONG_MIN. This doesn't work
well with the DISPID lookup, which is a LONG.
Finally we fix a potential double-free due to erroneously destroying the return value of
zend_read_property().
---
Given that this is completely broken as of PHP 8.0.0 at least, and apparently nobody has complained,
I think we're good targeting master (we can backport later if necessary).
Note that this doesn't fix calling methods, which is broken since 2005, because
DISPATCH_METHOD|DISPATCH_PROPERTYGET is passed as flag, and the latter is always
prioritized in disp_invokeex() (what is likely good for regular COM objects).