use reallocarray, and avoid this << 1 ugliness.
ok doug
obvious reallocarray() use
ok doug
Userland reallocarray() audit.

Avoid potential integer overflow in the size argument of malloc() and
realloc() by using reallocarray() to avoid unchecked multiplication.

ok deraadt@