com php-src: Partial fix for bug #68365 (zend_mm_heap c orrupted after memory overflow in zend_hash_copy ): Zend/zend_variables.c
| From: | JulienPauli | Date: | Wed, 12 Nov 2014 09:14:46 +0000 |
| Subject: | com php-src: Partial fix for bug #68365 (zend_mm_heap c orrupted after memory overflow in zend_hash_copy ): Zend/zend_variables.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-83044@lists.php.net to get a copy of this message | ||
Commit: ae106ba62fa15d5d450c724c3aac11a1c346201f
Author: Dmitry Stogov <dmitry@zend.com> Fri, 7 Nov 2014 09:46:49 +0300
Committer: Julien Pauli <jpauli@php.net> Wed, 12 Nov 2014 10:14:46 +0100
Parents: 8736632499a671605d8e11fcfc2a6049f2259e0b
Branches: PHP-5.5.19
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ae106ba62fa15d5d450c724c3aac11a1c346201f
Log:
Partial fix for bug #68365 (zend_mm_heap corrupted after memory overflow in zend_hash_copy)
Bugs:
https://bugs.php.net/68365
Changed paths:
M Zend/zend_variables.c
Diff:
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index 9674de5..cc73c37 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -135,9 +135,9 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
}
ALLOC_HASHTABLE_REL(tmp_ht);
zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0);
+ zvalue->value.ht = tmp_ht;
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp,
sizeof(zval *));
tmp_ht->nNextFreeElement = original_ht->nNextFreeElement;
- zvalue->value.ht = tmp_ht;
}
break;
case IS_OBJECT: