svn commit: samba r8517 - in branches/SAMBA_4_0/source/lib/ldb/common: .

tridge at samba.org tridge at samba.org
Sun Jul 17 09:06:58 GMT 2005


Author: tridge
Date: 2005-07-17 09:06:58 +0000 (Sun, 17 Jul 2005)
New Revision: 8517

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

Log:
fixed a crash bug in ldb_dn_compare_base()

Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb_dn.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_dn.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb_dn.c	2005-07-16 18:17:08 UTC (rev 8516)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_dn.c	2005-07-17 09:06:58 UTC (rev 8517)
@@ -412,13 +412,13 @@
 		   const struct ldb_dn *base,
 		   const struct ldb_dn *dn)
 {
-	int i, ret;
+	int ret;
 	int n0, n1;
 
 	/* if the number of components doesn't match they differ */
 	n0 = base->comp_num - 1;
 	n1 = dn->comp_num - 1;
-	for (i = 0; i < base->comp_num; i++, n0--, n1--) {
+	while (n0 >= 0 && n1 >= 0) {
 		const struct ldb_attrib_handler *h;
 
 		/* compare names (attribute names are guaranteed to be ASCII only) */
@@ -435,6 +435,8 @@
 		if (ret) {
 			return ret;
 		}
+		n1--;
+		n0--;
 	}
 
 	return 0;



More information about the samba-cvs mailing list