[Fedora-directory-commits] ldapserver/ldap/servers/slapd modutil.c, 1.5, 1.6

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Fri Oct 13 17:54:55 UTC 2006


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16333

Modified Files:
	modutil.c 
Log Message:
Bug(s) fixed: 204623
Bug Description: deleting attributes when changing password causes server crash
Reviewed by: nhosoi (Thanks!)
Fix Description: From Michal: "The function mod2smod does not check for mod->mod_bvalues being NULL and tries
to dereference it (modutil.c:370). This function happens to be called only by
slapi_mods_get_{first,next}_smod(), which are in turn called only by
check_trivial_words() in pw.c; this is why the crash appears only when checking
password syntax."
I added the same check for the mod_values case - even though the
code says this should never be called, better to be safe than sorry.
Platforms tested: RHEL4



Index: modutil.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/modutil.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- modutil.c	19 Apr 2005 22:07:36 -0000	1.5
+++ modutil.c	13 Oct 2006 17:54:52 -0000	1.6
@@ -367,7 +367,7 @@
 
 	if (mod->mod_op & LDAP_MOD_BVALUES)
 	{
-		while (mod->mod_bvalues[smod->num_values])
+		while (mod->mod_bvalues && mod->mod_bvalues[smod->num_values])
 		{
 			smod->num_values ++;
 		}
@@ -375,7 +375,7 @@
 	else
 	{
 		PR_ASSERT(0); /* ggood shouldn't ever use string values in server */
-		while (mod->mod_values[smod->num_values])
+		while (mod->mod_values && mod->mod_values[smod->num_values])
 		{
 			smod->num_values ++;
 		}




More information about the Fedora-directory-commits mailing list