summaryrefslogtreecommitdiff
path: root/Zend/zend_hash.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-03-06 01:02:31 +0300
committerDmitry Stogov <dmitry@zend.com>2018-03-06 01:02:31 +0300
commit47f5f878260ede087a780402e1853afbe8dbf6cb (patch)
tree275477c27d456bd0b75ecb44a8053c0c66883591 /Zend/zend_hash.c
parentd740024e350b08fba46e62946c2a1d81e6c64fa1 (diff)
parentb48d2f6d10c73aca9b77894e5c94ab580fe703d2 (diff)
downloadphp-git-47f5f878260ede087a780402e1853afbe8dbf6cb.tar.gz
Merge branch 'PHP-7.2'
* PHP-7.2: Don't keep HashTable.pDestructor in SHM and always set it into ZVAL_PTR_DTOR in zval_array_dup(). Keeping pointer to a function in SHM is not safe because of ASLR.
Diffstat (limited to 'Zend/zend_hash.c')
-rw-r--r--Zend/zend_hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index a33818edef..681588bc9a 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -1831,7 +1831,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
GC_TYPE_INFO(target) = IS_ARRAY | (GC_COLLECTABLE << GC_FLAGS_SHIFT);
target->nTableSize = source->nTableSize;
- target->pDestructor = source->pDestructor;
+ target->pDestructor = ZVAL_PTR_DTOR;
if (source->nNumUsed == 0) {
HT_FLAGS(target) = (HT_FLAGS(source) & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED)) | HASH_FLAG_STATIC_KEYS;