[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Fedora-directory-commits] ldapserver/ldap/servers/plugins/statechange statechange.c, 1.7, 1.8



Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/statechange
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21558/ldapserver/ldap/servers/plugins/statechange

Modified Files:
	statechange.c 
Log Message:
Resolves: bug 297221
Description: rhds71 Malformed Dynamic Authorization Group makes Directory Server Crash
Reviewed by: supplemental
Fix Description: In some cases, it is ok if the filter is NULL.  So just allow NULL in those cases.  slapi_str2filter must take either NULL or a writable string, so make sure we pass those in correctly.



Index: statechange.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/statechange/statechange.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- statechange.c	18 Oct 2007 22:25:14 -0000	1.7
+++ statechange.c	19 Oct 2007 15:36:01 -0000	1.8
@@ -331,7 +331,8 @@
 			item->dn = 0;
 		item->filter = slapi_ch_strdup(filter);
 		item->caller_data = caller_data;
-		if (NULL == (item->realfilter = slapi_str2filter(writable_filter))) {
+		if (writable_filter &&
+			(NULL == (item->realfilter = slapi_str2filter(writable_filter)))) {
 			slapi_log_error(SLAPI_LOG_FATAL, SCN_PLUGIN_SUBSYSTEM,
 							"Error: invalid filter in statechange entry [%s]: [%s]\n",
 							dn, filter);
@@ -341,6 +342,8 @@
 			slapi_ch_free_string(&writable_filter);
 			slapi_ch_free((void **)&item);
 			return -1;
+		} else if (!writable_filter) {
+			item->realfilter = NULL;
 		}
 		item->func = func;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]