Skip to content

Zend: ZEND_CLONE null dereference when the clone handler returns NULL. - #25565

Open
devnexen wants to merge 2 commits into
php:PHP-8.5from
devnexen:gh25304_85
Open

devnexen wants to merge 2 commits into
php:PHP-8.5from
devnexen:gh25304_85

Conversation

@devnexen

Copy link
Copy Markdown
Member

ZEND_CLONE stored the clone handler's return value unchecked. A handler that threw and returned NULL, as zend_ffi_free_clone_obj() does, left an IS_OBJECT result with a null pointer that ZEND_HANDLE_EXCEPTION released. The uri clone handler hit it once GH-25408 kept the opline of a delayed OOM, which caused its revert. The result is now left undefined.

ZEND_CLONE stored the clone handler's return value unchecked. A handler
that threw and returned NULL, as zend_ffi_free_clone_obj() does, left
an IS_OBJECT result with a null pointer that ZEND_HANDLE_EXCEPTION
released. The uri clone handler hit it once phpGH-25408 kept the opline of
a delayed OOM, which caused its revert. The result is now left undefined.
@devnexen
devnexen marked this pull request as ready for review November 18, 2026 19:16
@devnexen
devnexen requested a review from dstogov as a code owner November 18, 2026 19:16
@devnexen
devnexen requested a review from arnaud-lb November 18, 2026 19:17

@iliaal iliaal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: perhaps move the test to ext/ffi?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants