[Date Prev][Date Next]
Patch: bdb_db_hash() problems (ITS#1726)
Full_Name: Hallvard B. Furuseth
Version: HEAD (2002-04-02)
Submission from: (NULL) (184.108.40.206)
bdb_db_hash() has 3 problems:
- it accesses the bytes argument as an u_int32_t*, even though I can
see no guarantee that bytes is aligned for integer access.
- It expects a 4-byte value, but db->open() tests it with a string.
- It can crash on hosts where integers have padding bits, since bad
values for padding bits can cause a crash.
Here is a patch. It removes the '#if LUTIL_HASH_BYTES' too, since if
the #if fails it's still possible to use a simpler hash function than
the one bdb provides.