[dovecot-cvs] dovecot/src/auth db-ldap.c, 1.27, 1.28 passdb-ldap.c, 1.25, 1.26 userdb-ldap.c, 1.29, 1.30

cras at dovecot.org cras at dovecot.org
Wed Mar 16 21:04:01 EET 2005


Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv21671

Modified Files:
	db-ldap.c passdb-ldap.c userdb-ldap.c 
Log Message:
LDAP crashfixes.



Index: db-ldap.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/db-ldap.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- db-ldap.c	26 Feb 2005 22:55:03 -0000	1.27
+++ db-ldap.c	16 Mar 2005 19:03:58 -0000	1.28
@@ -281,8 +281,9 @@
 	t_push();
 	attr = t_strsplit(attrlist, ",");
 
+	/* @UNSAFE */
 	for (size = 0; attr[size] != NULL; size++) ;
-	conn->attr_names = p_new(conn->pool, char *, size);
+	conn->attr_names = p_new(conn->pool, char *, size + 1);
 
 	for (i = 0; i < size; i++) {
 		p = strchr(attr[i], '=');
@@ -394,6 +395,7 @@
 {
 	if (--conn->refcount > 0)
 		return;
+	i_assert(conn->refcount == 0);
 
 	ldap_conn_close(conn);
 

Index: passdb-ldap.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-ldap.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- passdb-ldap.c	28 Feb 2005 22:19:21 -0000	1.25
+++ passdb-ldap.c	16 Mar 2005 19:03:58 -0000	1.26
@@ -234,7 +234,6 @@
 {
 	db_ldap_unref(passdb_ldap_conn);
 	i_free(passdb_ldap_cache_key);
-	i_free(passdb_ldap_conn);
 }
 
 struct passdb_module passdb_ldap = {

Index: userdb-ldap.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/userdb-ldap.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- userdb-ldap.c	28 Feb 2005 22:19:21 -0000	1.29
+++ userdb-ldap.c	16 Mar 2005 19:03:58 -0000	1.30
@@ -211,7 +211,6 @@
 static void userdb_ldap_deinit(void)
 {
 	db_ldap_unref(userdb_ldap_conn);
-	i_free(userdb_ldap_conn);
 }
 
 struct userdb_module userdb_ldap = {



More information about the dovecot-cvs mailing list