From 8af14024c2134da5042fbafa01e70b6e0b338cd7 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 31 Jul 2019 18:05:40 +0200 Subject: [PATCH] Fix 78213: Empty row pocket We have to ensure that we don't create an arena which is smaller than its header, regardless of the configured alignment. --- NEWS | 3 +++ ext/mysqlnd/mysqlnd_block_alloc.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 6e6407aed64..db44d9b5355 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,9 @@ PHP NEWS - LiteSpeed: . Updated to LiteSpeed SAPI V7.5 (Fixed clean shutdown). (George Wang) +- MySQLnd: + . Fixed bug #78213 (Empty row pocket). (cmb) + - Standard: . Fixed bug #69100 (Bus error from stream_copy_to_stream (file -> SSL stream) with invalid length). (Nikita) diff --git a/ext/mysqlnd/mysqlnd_block_alloc.c b/ext/mysqlnd/mysqlnd_block_alloc.c index e1d3f846ec8..10f6bd3b6db 100644 --- a/ext/mysqlnd/mysqlnd_block_alloc.c +++ b/ext/mysqlnd/mysqlnd_block_alloc.c @@ -161,7 +161,7 @@ mysqlnd_mempool_create(size_t arena_size) MYSQLND_MEMORY_POOL * ret; DBG_ENTER("mysqlnd_mempool_create"); - arena = mysqlnd_arena_create(MAX(arena_size, sizeof(zend_arena))); + arena = mysqlnd_arena_create(MAX(arena_size, ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena)))); ret = mysqlnd_arena_alloc(&arena, sizeof(MYSQLND_MEMORY_POOL)); ret->arena = arena; ret->last = NULL;