diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-08-26 21:32:20 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-08-26 21:32:20 +0400 |
commit | cb37fe1aae9470659e67ca5286168883bef43f35 (patch) | |
tree | 3fada04afa74796bc50d6ec027ff4604bdf543c6 /Zend/zend_alloc.c | |
parent | d285e346daad8b630c71cd599493825e66056181 (diff) | |
download | php-git-cb37fe1aae9470659e67ca5286168883bef43f35.tar.gz |
Fixed zero-size allocation in debug build
Diffstat (limited to 'Zend/zend_alloc.c')
-rw-r--r-- | Zend/zend_alloc.c | 2 |
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) { |