diff --git a/NEWS b/NEWS index d1e50dfe270..5c36e386f92 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.1.0beta2 +- MySQLnd: + . Fixed bug #63327 (Crash (Bus Error) in mysqlnd due to wrong alignment). + (Nikita) + - Opcache: . Fixed Bug #81255 (Memory leak in PHPUnit with functional JIT) . Fixed Bug #80959 (infinite loop in building cfg during JIT compilation) diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c index a9c480c0f54..73770417ab6 100644 --- a/ext/mysqlnd/mysqlnd_alloc.c +++ b/ext/mysqlnd/mysqlnd_alloc.c @@ -61,9 +61,10 @@ PHPAPI const char * mysqlnd_debug_std_no_trace_funcs[] = #define __zend_orig_lineno 0 #endif -#define REAL_SIZE(s) (collect_memory_statistics? (s) + sizeof(size_t) : (s)) -#define REAL_PTR(p) (collect_memory_statistics && (p)? (((char *)(p)) - sizeof(size_t)) : (p)) -#define FAKE_PTR(p) (collect_memory_statistics && (p)? (((char *)(p)) + sizeof(size_t)) : (p)) +#define EXTRA_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(size_t)) +#define REAL_SIZE(s) (collect_memory_statistics? (s) + EXTRA_SIZE : (s)) +#define REAL_PTR(p) (collect_memory_statistics && (p)? (((char *)(p)) - EXTRA_SIZE) : (p)) +#define FAKE_PTR(p) (collect_memory_statistics && (p)? (((char *)(p)) + EXTRA_SIZE) : (p)) /* {{{ _mysqlnd_emalloc */ static void * _mysqlnd_emalloc(size_t size MYSQLND_MEM_D)