ldap/servers/plugins/replication/windows_connection.c | 3 ++-
ldap/servers/slapd/auth.c | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)
New commits:
commit 8a15fd460396e7d04a7907d4948493afba2b8083
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Thu Feb 10 15:23:20 2011 -0700
Bug 676689 - crash while adding a new user to be synced to windows
https://bugzilla.redhat.com/show_bug.cgi?id=676689
Resolves: bug 676689
Bug Description: crash while adding a new user to be synced to windows
Reviewed by: nkinder (Thanks!)
Branch: 389-ds-base-1.2.8
Fix Description: The OpenLDAP ldap_next_entry() function will assert and
abort if passed a NULL message. Mozldap ldap_next_entry() will just return
NULL. Fix the server to not pass NULL to ldap_next_entry().
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 82b362176a8874ace0fd53e69ca6838d33a4881a)
diff --git a/ldap/servers/plugins/replication/windows_connection.c
b/ldap/servers/plugins/replication/windows_connection.c
index f0b8237..50c2abf 100644
--- a/ldap/servers/plugins/replication/windows_connection.c
+++ b/ldap/servers/plugins/replication/windows_connection.c
@@ -688,7 +688,8 @@ windows_search_entry_ext(Repl_Connection *conn, char* searchbase, char
*filter,
/* See if there are any more entries : if so then that's an error
* but we still need to get them to avoid gumming up the connection
*/
- while (NULL != ( message = ldap_next_entry(conn->ld,message))) ;
+ /* have to check message first - cannot pass a NULL message */
+ while (message && (NULL != ( message = ldap_next_entry(conn->ld,message))))
;
return_value = CONN_OPERATION_SUCCESS;
}
else if (IS_DISCONNECT_ERROR(ldap_rc))
diff --git a/ldap/servers/slapd/auth.c b/ldap/servers/slapd/auth.c
index 4b56e5e..2c25483 100644
--- a/ldap/servers/slapd/auth.c
+++ b/ldap/servers/slapd/auth.c
@@ -186,7 +186,11 @@ slapu_next_entry( LDAP* ld, LDAPMessage* msg )
{
Slapi_Entry** entry = (Slapi_Entry**)msg;
if (ld != internal_ld) {
- return ldap_next_entry (ld, msg);
+ if (msg) {
+ return ldap_next_entry (ld, msg);
+ } else {
+ return NULL;
+ }
}
if (entry && *entry && *++entry) {
return (LDAPMessage*)entry;