[php-src] PR #21786: Fix GH-21776: use-after-free in zend_std_read_property magic __isset
| From: | iliaal | Date: | Fri, 17 Apr 2026 12:39:26 +0000 |
| Subject: | [php-src] PR #21786: Fix GH-21776: use-after-free in zend_std_read_property magic __isset | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-35757@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21786
Author: iliaal
Fixes #21776.
When
__isset drops the last non-temp reference to $this (e.g.
$GLOBALS['o'] = 0), the OBJ_RELEASE(zobj) after the
__isset
call freed the object before zend_std_read_property reached the
shared uninit_error check at zend_lazy_object_must_init(zobj).
ASAN reports a heap-use-after-free.
Defer the release via a local flag so zobj stays alive through the
lazy-init check and the recursive read on the initialized instance.
Route the two returns inside the lazy block through exit: so the
deferred release runs on those paths too.