summaryrefslogtreecommitdiffabout
path: root/src/bucket.c
Side-by-side diff
Diffstat (limited to 'src/bucket.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/bucket.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bucket.c b/src/bucket.c
index e17019c..a3e8f4e 100644
--- a/src/bucket.c
+++ b/src/bucket.c
@@ -143,7 +143,10 @@ _gdbm_get_bucket (GDBM_FILE dbf, int dir_index)
}
/* Validate the bucket */
bucket = dbf->bucket_cache[lru].ca_bucket;
- if (!(bucket->count >= 0 && bucket->count <= dbf->header->bucket_elems))
+ if (!(bucket->count >= 0
+ && bucket->count <= dbf->header->bucket_elems
+ && bucket->bucket_bits >= 0
+ && bucket->bucket_bits <= GDBM_HASH_BITS))
{
GDBM_SET_ERRNO (dbf, GDBM_BAD_BUCKET, TRUE);
return -1;

Return to:

Send suggestions and report system problems to the System administrator.