mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Fix #78620: Out of memory error
This commit is contained in:
commit
752a34fb2c
1
NEWS
1
NEWS
@ -5,6 +5,7 @@ PHP NEWS
|
||||
- Core:
|
||||
. Fixed bug #78535 (auto_detect_line_endings value not parsed as bool).
|
||||
(bugreportuser)
|
||||
. Fixed bug #78620 (Out of memory error). (cmb)
|
||||
|
||||
- Exif :
|
||||
. Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user