merged tdb transaction fix
authorAndrew Tridgell <tridge@samba.org>
Wed, 30 Jan 2008 22:48:46 +0000 (09:48 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 30 Jan 2008 22:48:46 +0000 (09:48 +1100)
source/lib/tdb/common/transaction.c

index c3e7a4e2c065d55492fbc9ddb3c1ff6946bf7057..4e2127be64484cbcb5faee1a6e5682c08425f26a 100644 (file)
@@ -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;
        }