mirror of
https://github.com/php/php-src.git
synced 2026-04-26 17:38:14 +02:00
It's safer to use zval_ptr_dtor() for iterator keys.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user