summaryrefslogtreecommitdiffabout
path: root/src
Side-by-side diff
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/bucket.c5
-rw-r--r--src/gdbmtool.c2
2 files changed, 5 insertions, 2 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;
diff --git a/src/gdbmtool.c b/src/gdbmtool.c
index dbb7510..6d56578 100644
--- a/src/gdbmtool.c
+++ b/src/gdbmtool.c
@@ -300,7 +300,7 @@ _gdbm_print_avail_list (FILE *fp, GDBM_FILE dbf)
/* Print the block! */
fprintf (fp, _("\nblock = %d\nsize = %d\ncount = %d\n"), temp,
av_stk->size, av_stk->count);
- if (gdbm_avail_block_validate (dbf, av_stk))
+ if (gdbm_avail_block_validate (dbf, av_stk) == 0)
av_table_display (av_stk->av_table, av_stk->count, fp);
else
terror (_("invalid avail_block"));

Return to:

Send suggestions and report system problems to the System administrator.