From: Dmitry Stogov Date: Mon, 21 Jul 2008 17:06:16 +0000 (+0000) Subject: Added check for small ZEMD_MM_SEG_SIZE X-Git-Tag: BEFORE_HEAD_NS_CHANGE~1163 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49952e6452acbafcbb4582209ed2204f424c3e1a;p=php Added check for small ZEMD_MM_SEG_SIZE --- diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 8ea0444669..d758b8bbf4 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -1153,6 +1153,9 @@ ZEND_API zend_mm_heap *zend_mm_startup(void) /* {{{ */ if (zend_mm_low_bit(seg_size) != zend_mm_high_bit(seg_size)) { fprintf(stderr, "ZEND_MM_SEG_SIZE must be a power of two\n"); exit(255); + } else if (seg_size < ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE) { + fprintf(stderr, "ZEND_MM_SEG_SIZE is too small\n"); + exit(255); } } else { seg_size = ZEND_MM_SEG_SIZE;