This is taken from OpenSSH Portable, which in turn takes it from
OpenBSD.
reallocarray wraps the stdlib's realloc function. It takes two size
arguments and checks for overflow, like calloc, but doesn't zero the
memory. Therefore, it allows us to do overflow-safe array reallocations
and overflow-safe unzeroed array allocations, which the stdlib
allocation functions don't.
We have a bunch of specific array allocation macros, none of
which check for overflow. reallocarray should be able to replace them.