summaryrefslogtreecommitdiff
path: root/Zend/zend_alloc.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-08-26 21:32:20 +0400
committerDmitry Stogov <dmitry@zend.com>2014-08-26 21:32:20 +0400
commitcb37fe1aae9470659e67ca5286168883bef43f35 (patch)
tree3fada04afa74796bc50d6ec027ff4604bdf543c6 /Zend/zend_alloc.c
parentd285e346daad8b630c71cd599493825e66056181 (diff)
downloadphp-git-cb37fe1aae9470659e67ca5286168883bef43f35.tar.gz
Fixed zero-size allocation in debug build
Diffstat (limited to 'Zend/zend_alloc.c')
-rw-r--r--Zend/zend_alloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index 7d7a481c80..805cc856bf 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -1169,6 +1169,8 @@ static zend_always_inline void *zend_mm_alloc_heap(zend_mm_heap *heap, size_t si
size_t real_size = size;
zend_mm_debug_info *dbg;
+ /* special handling for zero-size allocation */
+ size = MAX(size, 1);
size = ZEND_MM_ALIGNED_SIZE(size) + ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_debug_info));
#endif
if (size <= ZEND_MM_MAX_SMALL_SIZE) {