Skip to content

Fix OSS-Fuzz #536440507: Immutable class incorrect assertion - #23781

Open
ndossche wants to merge 1 commit into
php:PHP-8.4from
ndossche:oss-fuzz-536440507
Open

ndossche wants to merge 1 commit into
php:PHP-8.4from
ndossche:oss-fuzz-536440507

Conversation

@ndossche

Copy link
Copy Markdown
Member

For immutable classes, the flag for updated constants lives on the mutable part (see zend_update_class_constants).
That means the assertion is bogus and can be replaced with a more complex check via a helper function.
For the case where we perform the flags check, but not as an assertion but as a proper check, deferring to zend_update_class_constants() is enough because it already checks the flags correctly itself.

@ndossche
ndossche requested a review from arnaud-lb September 19, 2026 22:39
@ndossche
ndossche force-pushed the oss-fuzz-536440507 branch 2 times, most recently from 5ec58c6 to 71b5bdc Compare September 20, 2026 09:20
For immutable classes, the flag for updated constants lives on the
mutable part (see zend_update_class_constants).
That means the assertion is bogus and can be replaced with a more
complex check via a helper function.
For the case where we perform the flags check, but not as an assertion
but as a proper check, deferring to zend_update_class_constants() is
enough because it already checks the flags correctly itself.
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.

1 participant