Skip to content

Commit 9d4064a

Browse files
committed
Added check for small ZEMD_MM_SEG_SIZE
1 parent 07586f6 commit 9d4064a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Zend/zend_alloc.c

+3
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,9 @@ ZEND_API zend_mm_heap *zend_mm_startup(void)
11251125
if (zend_mm_low_bit(seg_size) != zend_mm_high_bit(seg_size)) {
11261126
fprintf(stderr, "ZEND_MM_SEG_SIZE must be a power of two\n");
11271127
exit(255);
1128+
} else if (seg_size < ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE) {
1129+
fprintf(stderr, "ZEND_MM_SEG_SIZE is too small\n");
1130+
exit(255);
11281131
}
11291132
} else {
11301133
seg_size = ZEND_MM_SEG_SIZE;

0 commit comments

Comments
 (0)