]> granicus.if.org Git - php/commitdiff
It's safer to use zval_ptr_dtor() for iterator keys.
authorDmitry Stogov <dmitry@zend.com>
Thu, 5 Jul 2018 13:56:52 +0000 (16:56 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 5 Jul 2018 13:56:52 +0000 (16:56 +0300)
ext/phar/phar_object.c
ext/soap/php_encoding.c

index 2e351454f39b2d65291a20dc6a36bb9f1e1a480b..2c404ca90b07f8548fa40c3147bd2ecc093e0cea 100644 (file)
@@ -1439,7 +1439,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
                                }
 
                                if (Z_TYPE(key) != IS_STRING) {
-                                       zval_dtor(&key);
+                                       zval_ptr_dtor(&key);
                                        zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
                                        return ZEND_HASH_APPLY_STOP;
                                }
@@ -1567,7 +1567,7 @@ phar_spl_fileinfo:
                        }
 
                        if (Z_TYPE(key) != IS_STRING) {
-                               zval_dtor(&key);
+                               zval_ptr_dtor(&key);
                                zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
                                return ZEND_HASH_APPLY_STOP;
                        }
index 0962e40118fa6a8865ee472c25a52b9ce247b31c..628c4e03265bc1245efe8640e66c32d37e8f36ab 100644 (file)
@@ -2266,7 +2266,7 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
                                }
                                array_set_zval_key(Z_ARRVAL(array_copy), &key, val);
                                zval_ptr_dtor(val);
-                               zval_dtor(&key);
+                               zval_ptr_dtor(&key);
                        } else {
                                add_next_index_zval(&array_copy, val);
                        }