Re: object_properties_load() does not work for non-string keys - intentional?
| From: | Stanislav Malyshev | Date: | Wed, 02 Sep 2015 07:41:17 +0000 |
| Subject: | Re: object_properties_load() does not work for non-string keys - intentional? | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88005@lists.php.net to get a copy of this message | ||
Hi!
> I don't see the crash. Integer keys are supported in exactly the same
> way as it was in PHP-5.
I see the crash on this test:
https://github.com/smalyshev/php-src/blob/master/ext/spl/tests/bug70155.phpt
I'm not sure how integer keys are supported the same way if I see this
in the code:
https://github.com/php/php-src/blob/master/Zend/zend_API.c#L1248
ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
property_info = zend_get_property_info(object->ce, key, 1);
The loop doesn't even consider the possibility of key being NULL (which
happens with integer key) and only considers string keys, and, if the
key is integer, zend_get_property_info gets null as key argument and
segfaults.
--
Stas Malyshev
smalyshev@gmail.com