svn commit: samba r5531 - in trunk/source/tdb: .

jra at samba.org jra at samba.org
Thu Feb 24 01:06:57 GMT 2005


Author: jra
Date: 2005-02-24 01:06:57 +0000 (Thu, 24 Feb 2005)
New Revision: 5531

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5531

Log:
Patch to detect infinite loops when traversing a tdb from "Shlomi Yaakobovich" <Shlomi at exanet.com>
Jeremy.

Modified:
   trunk/source/tdb/tdb.c


Changeset:
Modified: trunk/source/tdb/tdb.c
===================================================================
--- trunk/source/tdb/tdb.c	2005-02-24 01:03:35 UTC (rev 5530)
+++ trunk/source/tdb/tdb.c	2005-02-24 01:06:57 UTC (rev 5531)
@@ -1272,6 +1272,13 @@
 					goto fail;
 				return tlock->off;
 			}
+
+			/* Detect infinite loops. From "Shlomi Yaakobovich" <Shlomi at 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;



More information about the samba-cvs mailing list