]> granicus.if.org Git - php/commitdiff
Fixed inaccurate condition
authorDmitry Stogov <dmitry@zend.com>
Tue, 7 Nov 2017 07:29:17 +0000 (10:29 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 7 Nov 2017 07:29:17 +0000 (10:29 +0300)
Zend/zend_alloc.c

index 9496c1440d94141637b329e4cd24be377db5ee5b..a780a7c05eb95427f71bc381d7ef2ce16ddac77f 100644 (file)
@@ -1567,7 +1567,7 @@ static zend_always_inline void *zend_mm_realloc_heap(zend_mm_heap *heap, void *p
                                /* Check if requested size fits into current bin */
                                if (size <= old_size) {
                                        /* Check if truncation is necessary */
-                                       if (old_bin_num > 0 && size <= bin_data_size[old_bin_num - 1]) {
+                                       if (old_bin_num > 0 && size < bin_data_size[old_bin_num - 1]) {
                                                /* truncation */
                                                ret = zend_mm_alloc_small(heap, size, ZEND_MM_SMALL_SIZE_TO_BIN(size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
                                                copy_size = use_copy_size ? MIN(size, copy_size) : size;