diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-10-02 18:19:53 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-10-02 18:20:09 +0200 |
commit | 752a34fb2cc2ae3154471ba8698d7e2fcfa4ae22 (patch) | |
tree | 1c1a93ede207825d4c629954bdff4afbb8d1eb7a /Zend | |
parent | 3c42471ef84dcd6008ee54c0dc6cecb47b5da86b (diff) | |
parent | 8ce04df7e0108a10f7b782a28204e9384ab1129c (diff) | |
download | php-git-752a34fb2cc2ae3154471ba8698d7e2fcfa4ae22.tar.gz |
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
Fix #78620: Out of memory error
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_alloc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 035e23f1db..744203da5e 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -1799,10 +1799,15 @@ static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D void *ptr; #if ZEND_MM_LIMIT + if (UNEXPECTED(new_size == 0)) { + /* overflow in ZEND_MM_ALIGNED_SIZE_EX */ + goto memory_limit_exhausted; + } if (UNEXPECTED(new_size > heap->limit - heap->real_size)) { if (zend_mm_gc(heap) && new_size <= heap->limit - heap->real_size) { /* pass */ } else if (heap->overflow == 0) { +memory_limit_exhausted: #if ZEND_DEBUG zend_mm_safe_error(heap, "Allowed memory size of %zu bytes exhausted at %s:%d (tried to allocate %zu bytes)", heap->limit, __zend_filename, __zend_lineno, size); #else |