mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
r5532: Patch to detect infinite loops when traversing a tdb from "Shlomi Yaakobovich" <Shlomi@exanet.com>
Jeremy.
This commit is contained in:
parent
98a07e1520
commit
f997c28bb8
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user