The hash(3) database code does not validate the on-disk database header,
leaving it open to several OOB read and write vulnerabilities.
This change adds basic header validation and array bounds checking to
parts of the hash(3) code that can be manipulated by messing with the
database header.
Sponsored by: Klara, Inc.
MFC after: 1 month