aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2021-09-16 08:45:29 +0300
committerSergey Poznyakoff <gray@gnu.org>2021-09-16 08:55:57 +0300
commit8952f7fd7cebffbe4ecf8c232e4435c5de72678a (patch)
tree917a47ba2f4444bc9410c43a8ff569e5327128fb /src
parentb962f06587a2c8fa6e6155153fa2b0e4e15f9501 (diff)
downloadgdbm-8952f7fd7cebffbe4ecf8c232e4435c5de72678a.tar.gz
gdbm-8952f7fd7cebffbe4ecf8c232e4435c5de72678a.tar.bz2
Fix computation of dbf->avail->count after pushing new avail block.
This is a very long-standing bug that caused a loss of an avail entry if the original avail table had odd number of entries. * src/falloc.c (push_avail_block): Fix computation of dbf->avail->count.
Diffstat (limited to 'src')
-rw-r--r--src/falloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/falloc.c b/src/falloc.c
index 979d77a..890ed7b 100644
--- a/src/falloc.c
+++ b/src/falloc.c
@@ -314,8 +314,8 @@ push_avail_block (GDBM_FILE dbf)
else
dbf->avail->av_table[index>>1] = dbf->avail->av_table[index];
- /* Update the header avail count to previous size divided by 2. */
- dbf->avail->count >>= 1;
+ /* Update the header avail count. */
+ dbf->avail->count -= temp->count;
rc = 0;
do

Return to:

Send suggestions and report system problems to the System administrator.