-
Problem report
-
Resolution: Won't fix
-
Blocker
-
None
-
3.0.27, 4.0.7, 4.2.1
-
None
src/libs/zbxmemory/memalloc.c : mem_bucket_by_size() code is following
static int mem_bucket_by_size(zbx_uint64_t size)
{ if (size < MEM_MIN_BUCKET_SIZE) return 0; if (size < MEM_MAX_BUCKET_SIZE) return (size - MEM_MIN_BUCKET_SIZE) >> 3; return MEM_BUCKET_COUNT - 1; }It must be following, especially size over MEM_MAX_BUCKET_SIZE is critical bug.
static int mem_bucket_by_size(zbx_uint64_t size)
{ if (MEM_MIN_BUCKET_SIZE > size) return 0; if (MEM_MAX_BUCKET_SIZE < size) return (size - MEM_MIN_BUCKET_SIZE) >> 3; return MEM_BUCKET_COUNT - 1; }