aboutsummaryrefslogtreecommitdiff
path: root/src/falloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/falloc.c')
-rw-r--r--src/falloc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/falloc.c b/src/falloc.c
index 3f437a6..33a238a 100644
--- a/src/falloc.c
+++ b/src/falloc.c
@@ -154,3 +154,3 @@ _gdbm_free (GDBM_FILE dbf, off_t file_adr, int num_bytes)
/* Gets the avail block at the top of the stack and loads it into the
- active avail block. It does a "free" for itself! This can (and is)
+ active avail block. It does a "free" for itself! This can be (and is)
now called even when the avail block is not empty, so we must be
@@ -208,2 +208,9 @@ pop_avail_block (GDBM_FILE dbf)
+ if (!gdbm_avail_block_valid_p (new_blk))
+ {
+ gdbm_set_errno (dbf, GDBM_BAD_AVAIL, TRUE);
+ _gdbm_fatal (dbf, gdbm_db_strerror (dbf));
+ return -1;
+ }
+
/* Add the elements from the new block to the header. */
@@ -212,4 +219,4 @@ pop_avail_block (GDBM_FILE dbf)
{
- while(index < new_blk->count
- && dbf->header->avail.count < dbf->header->avail.size)
+ while (index < new_blk->count
+ && dbf->header->avail.count < dbf->header->avail.size)
{

Return to:

Send suggestions and report system problems to the System administrator.