Skip to content

Fix oss-fuzz #71382 #15854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Fix oss-fuzz #71382 #15854

merged 1 commit into from
Sep 17, 2024

Conversation

arnaud-lb
Copy link
Member

@arnaud-lb arnaud-lb commented Sep 12, 2024

The return value of zho_build_properties_ex() is passed to ZVAL_ARR(), which sets the IS_TYPE_REFCOUNTED flag. Returning &zend_emtpy_array will crash later when trying to dtor the zval.

I'm fixing this by returning zend_new_array(0) instead of &zend_empty_array.

An alternative was to make ZVAL_ARR() aware of immutable arrays, like ZVAL_STR() is with interned strings, but I found no other problematic cases.

ZVAL_ARR() does not support immutable arrays as it incorrectly sets the
IS_TYPE_REFCOUNTED flag. Using zend_array_new(0) instead, as it's a rare case.
@arnaud-lb arnaud-lb marked this pull request as ready for review September 12, 2024 13:29
@arnaud-lb arnaud-lb requested a review from iluuu1994 September 12, 2024 13:29
Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

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

Thank you!

@arnaud-lb arnaud-lb merged commit 17d46bb into php:master Sep 17, 2024
10 checks passed
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