> Plus, if we wanted to, we could certainly write our own wrapper for malloc that took two arguments and multiplied them together with overflow checking. And in fact if we want an overflow-safe version of realloc, or if we don't want the memory to be zero-initialized, then... we still have to do that.
Like reallocarray(3) does?
buf = malloc(x * y);
// becomes
buf = reallocarray(NULL, x, y);
newbuf = realloc(buf, (x * y));
// becomes
newbuf = reallocarray(buf, x, y);