tdb2: careful on wrap.
[ccan] / ccan / tdb2 / open.c
index 02ec0eb68d7f4bf07702b26e2d16cc96e6345149..e238d99248b6ed5813418661a9bb86f3c1f966da 100644 (file)
@@ -747,7 +747,7 @@ finished:
        if (tdb->flags & TDB_VERSION1) {
                ecode = tdb1_probe_length(tdb);
        } else {
-               ecode = tdb->tdb2.io->oob(tdb, tdb->file->map_size + 1, true);
+               ecode = tdb->tdb2.io->oob(tdb, tdb->file->map_size, 1, true);
        }
        if (unlikely(ecode != TDB_SUCCESS))
                goto fail;