ISC_MEM_ZERO is broken on allocators with malloc_usable_size()
When BIND is built without jemalloc, ISC_MEM_ZERO is implemented in
jemalloc_shim.h
. This has a bug on systems that have malloc_size()
or malloc_usable_size(): memory is only zeroed up to the requested
size, not the allocated size. When an oversized allocation was
returned, and subsequently reallocated larger, memory between the
original requested size and the original allocated size could
contain unexpected nonzero junk. The realloc call does not know the
original requested size and only zeroes from the original allocated
size onwards.