From: Dmitry Stogov Date: Thu, 5 Jul 2018 13:56:52 +0000 (+0300) Subject: It's safer to use zval_ptr_dtor() for iterator keys. X-Git-Tag: php-7.3.0alpha4~117 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43d5a3665ddc8b871ccdcd10c4ffde408cd28d35;p=php It's safer to use zval_ptr_dtor() for iterator keys. --- diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 2e351454f3..2c404ca90b 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -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; } diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 0962e40118..628c4e0326 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -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); }