summaryrefslogtreecommitdiff
path: root/lib/tdb2/free.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-01-30 09:23:50 +1030
committerRusty Russell <rusty@rustcorp.com.au>2012-01-30 09:23:50 +1030
commit205e198471a481b849d05b5756261f1739c0c8b2 (patch)
tree1a3901d647eb9f3ecd63debc4ef98173e8083b4b /lib/tdb2/free.c
parent697a6e9504d9f3eefd97c7c822e90feddd9b9a3b (diff)
downloadsamba-205e198471a481b849d05b5756261f1739c0c8b2.tar.gz
samba-205e198471a481b849d05b5756261f1739c0c8b2.tar.bz2
samba-205e198471a481b849d05b5756261f1739c0c8b2.zip
tdb2: careful on wrap.
It's much harder to wrap a 64-bit tdb2 than a 32-bit tdb1, but we should still take care against bugs. Also, we should *not* cast the length to a size_t when comparing it to the stat result, in case size_t is 32 bit. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 6f7cb26e589cea081e71c59801eae87178967861)
Diffstat (limited to 'lib/tdb2/free.c')
-rw-r--r--lib/tdb2/free.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tdb2/free.c b/lib/tdb2/free.c
index bb819a2fd3..f8934d1d60 100644
--- a/lib/tdb2/free.c
+++ b/lib/tdb2/free.c
@@ -898,7 +898,7 @@ static enum TDB_ERROR tdb_expand(struct tdb_context *tdb, tdb_len_t size)
/* Someone else may have expanded the file, so retry. */
old_size = tdb->file->map_size;
- tdb->tdb2.io->oob(tdb, tdb->file->map_size + 1, true);
+ tdb->tdb2.io->oob(tdb, tdb->file->map_size, 1, true);
if (tdb->file->map_size != old_size) {
tdb_unlock_expand(tdb, F_WRLCK);
return TDB_SUCCESS;