Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory
cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30518/ldapserver/ldap/servers/plugins/replication
Modified Files:
windows_protocol_util.c
Log Message:
Resolves: bug 476127
Bug Description: rhds80 seg fault - pass sync - entry missing userPassword ?
Reviewed by: nkinder (Thanks!)
Fix Description: The fix is pretty obvious - just make sure we don't deref a NULL.
The reason for the NULL is due to a sequence of more than one modify for the userPassword
attribute, where one of the mods is a replace with no value or a delete of the attribute.
The bug has the details about how to reproduce. One thing I don't know is what client
is generating this sequence of operations . . .
Platforms tested: RHEL5
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: windows_protocol_util.c
===================================================================
RCS file:
/cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- windows_protocol_util.c 5 Dec 2008 22:41:52 -0000 1.43
+++ windows_protocol_util.c 15 Dec 2008 15:59:41 -0000 1.44
@@ -1812,7 +1812,8 @@
} else
{
/* password mods are treated specially */
- if (0 == slapi_attr_type_cmp(attr_type, PSEUDO_ATTR_UNHASHEDUSERPASSWORD,
SLAPI_TYPE_CMP_SUBTYPE) )
+ if ((0 == slapi_attr_type_cmp(attr_type, PSEUDO_ATTR_UNHASHEDUSERPASSWORD,
SLAPI_TYPE_CMP_SUBTYPE)) &&
+ mod && mod->mod_bvalues && mod->mod_bvalues[0] &&
mod->mod_bvalues[0]->bv_val)
{
char *password_value = NULL;
password_value = mod->mod_bvalues[0]->bv_val;