summaryrefslogtreecommitdiff
path: root/source3/lib/tdb/common/transaction.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/tdb/common/transaction.c')
-rw-r--r--source3/lib/tdb/common/transaction.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/lib/tdb/common/transaction.c b/source3/lib/tdb/common/transaction.c
index c3e7a4e2c0..4e2127be64 100644
--- a/source3/lib/tdb/common/transaction.c
+++ b/source3/lib/tdb/common/transaction.c
@@ -321,6 +321,9 @@ static int transaction_write_existing(struct tdb_context *tdb, tdb_off_t off,
if (blk == tdb->transaction->num_blocks-1 &&
off + len > tdb->transaction->last_block_size) {
+ if (off >= tdb->transaction->last_block_size) {
+ return 0;
+ }
len = tdb->transaction->last_block_size - off;
}