[php-src] PR #15854: Fix oss-fuzz #71382
| From: | arnaud-lb | Date: | Thu, 12 Sep 2024 12:19:57 +0000 |
| Subject: | [php-src] PR #15854: Fix oss-fuzz #71382 | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-28555@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/15854
Author: arnaud-lb
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 delref 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.