cvs: ZendEngine2(PHP_5_2) / zend_alloc.c

From: Date: Mon, 13 Nov 2006 10:28:46 +0000
Subject: cvs: ZendEngine2(PHP_5_2) / zend_alloc.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5402@lists.php.net to get a copy of this message
dmitry Mon Nov 13 10:28:46 2006 UTC Modified files: (Branch: PHP_5_2) /ZendEngine2 zend_alloc.c Log: Fixed incorrect heap corruptiuon detection code http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_alloc.c?r1=1.144.2.3.2.13&r2=1.144.2.3.2.14&diff_format=u Index: ZendEngine2/zend_alloc.c diff -u ZendEngine2/zend_alloc.c:1.144.2.3.2.13 ZendEngine2/zend_alloc.c:1.144.2.3.2.14 --- ZendEngine2/zend_alloc.c:1.144.2.3.2.13 Fri Nov 10 10:44:40 2006 +++ ZendEngine2/zend_alloc.c Mon Nov 13 10:28:46 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_alloc.c,v 1.144.2.3.2.13 2006/11/10 10:44:40 dmitry Exp $ */ +/* $Id: zend_alloc.c,v 1.144.2.3.2.14 2006/11/13 10:28:46 dmitry Exp $ */ #include "zend.h" #include "zend_alloc.h" @@ -666,6 +666,15 @@ p = ZEND_MM_NEXT_BLOCK(b); while (1) { + if (ZEND_MM_IS_GUARD_BLOCK(p)) { + ZEND_MM_CHECK_MAGIC(p, MEM_BLOCK_GUARD); + segment = segment->next_segment; + if (!segment) { + break; + } + p = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); + continue; + } q = ZEND_MM_NEXT_BLOCK(p); if (q <= p || (char*)q > (char*)segment + segment->size || @@ -686,14 +695,6 @@ zend_mm_panic("zend_mm_heap corrupted"); } } - if (ZEND_MM_IS_GUARD_BLOCK(q)) { - ZEND_MM_CHECK_MAGIC(q, MEM_BLOCK_GUARD); - segment = segment->next_segment; - if (!segment) { - break; - } - q = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); - } p = q; } return leaks;

« previous php.zend-engine.cvs (#5402) next »