Skip to content

Commit 9dfa843

Browse files
committed
Partial fix for bug #68365 (zend_mm_heap corrupted after memory overflow in zend_hash_copy)
1 parent 0ddcf2a commit 9dfa843

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_variables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
135135
}
136136
ALLOC_HASHTABLE_REL(tmp_ht);
137137
zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0);
138+
zvalue->value.ht = tmp_ht;
138139
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
139140
tmp_ht->nNextFreeElement = original_ht->nNextFreeElement;
140-
zvalue->value.ht = tmp_ht;
141141
}
142142
break;
143143
case IS_OBJECT:

0 commit comments

Comments
 (0)