aboutsummaryrefslogtreecommitdiff
path: root/src/bucket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bucket.c')
-rw-r--r--src/bucket.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/bucket.c b/src/bucket.c
index 6def504..ce1915a 100644
--- a/src/bucket.c
+++ b/src/bucket.c
@@ -72,8 +72,6 @@ _gdbm_get_bucket (GDBM_FILE dbf, int dir_index)
/* Is that one is not already current, we must find it. */
if (dbf->cache_entry->ca_adr != bucket_adr)
{
- size_t max_bucket_elts;
-
/* Look in the cache. */
for (index = 0; index < dbf->cache_size; index++)
{
@@ -120,13 +118,10 @@ _gdbm_get_bucket (GDBM_FILE dbf, int dir_index)
return -1;
}
/* Validate the bucket */
- max_bucket_elts =
- (dbf->header->bucket_size - sizeof(hash_bucket))
- / sizeof(bucket_element) + 1;
if (!(dbf->bucket->count >= 0
&& dbf->bucket->av_count >= 0
- && dbf->bucket->count <= max_bucket_elts
- && dbf->bucket->av_count <= max_bucket_elts))
+ && dbf->bucket->count <= dbf->header->bucket_elems
+ && dbf->bucket->av_count <= dbf->header->bucket_elems))
{
GDBM_SET_ERRNO (dbf, GDBM_BAD_BUCKET, TRUE);
return -1;

Return to:

Send suggestions and report system problems to the System administrator.