summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/tdb/tdb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index 45895d2ec7..b3d596f442 100644
--- a/source3/tdb/tdb.c
+++ b/source3/tdb/tdb.c
@@ -1272,6 +1272,13 @@ static int tdb_next_lock(TDB_CONTEXT *tdb, struct tdb_traverse_lock *tlock,
goto fail;
return tlock->off;
}
+
+ /* Detect infinite loops. From "Shlomi Yaakobovich" <Shlomi@exanet.com>. */
+ if (tlock->off == rec->next) {
+ TDB_LOG((tdb, 0, "tdb_next_lock: loop detected.\n"));
+ goto fail;
+ }
+
/* Try to clean dead ones from old traverses */
current = tlock->off;
tlock->off = rec->next;