mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-26 18:35:42 +00:00
Fixed possible HashTable modification in its destructor
This commit is contained in:
1 parent
dfe1fd73bf
commit
3e4c22b499
1 file changed
+8
-4
+8
-4
@@ -508,13 +508,17 @@ static zend_always_inline void _zend_hash_del_el_ex(HashTable *ht, uint idx, Buc
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ht->pDestructor) {
|
||||
ht->pDestructor(&p->val);
|
||||
}
|
||||
if (p->key) {
|
||||
STR_RELEASE(p->key);
|
||||
}
|
||||
Z_TYPE(p->val) = IS_UNDEF;
|
||||
if (ht->pDestructor) {
|
||||
zval tmp;
|
||||
ZVAL_COPY_VALUE(&tmp, &p->val);
|
||||
ZVAL_UNDEF(&p->val);
|
||||
ht->pDestructor(&tmp);
|
||||
} else {
|
||||
ZVAL_UNDEF(&p->val);
|
||||
}
|
||||
}
|
||||
|
||||
static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint idx, Bucket *p)
|
||||
|
||||
Reference in new issue
Block a user