Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/dna
In directory
cvs-int.fedora.redhat.com:/tmp/cvs-serv3904/ldapserver/ldap/servers/plugins/dna
Modified Files:
dna.c
Log Message:
Resolves: bug 297221
Bug Description: rhds71 Malformed Dynamic Authorization Group makes Directory Server
Crash
Reviewed by: nhosoi (Thanks!)
Fix Description: The problem was that we were not checking the return value of
slapi_str2filter(). I added a check at the crash site, and it will not print out a
helpful error message. I did a search through the code looking for other similar places
and found a couple. I added similar code in those places.
I added an initialization of a buffer to null, as suggested by nhosoi.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
Index: dna.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/dna/dna.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- dna.c 18 Oct 2007 00:08:28 -0000 1.2
+++ dna.c 18 Oct 2007 22:25:14 -0000 1.3
@@ -512,7 +512,12 @@
value = slapi_entry_attr_get_charptr(e, DNA_FILTER);
if (value) {
- entry->filter = slapi_str2filter(value);
+ if (NULL == (entry->filter = slapi_str2filter(value))) {
+ slapi_log_error(SLAPI_LOG_FATAL, DNA_PLUGIN_SUBSYSTEM ,
+ "Error: Invalid search filter in entry [%s]: [%s]\n",
+ entry->dn, value);
+ goto bail;
+ }
}
else
goto bail;
@@ -1170,6 +1175,7 @@
printf("<---- prefix ---------> %s\n", entry->prefix);
printf("<---- next value -----> %lu\n", entry->nextval);
printf("<---- interval -------> %lu\n", entry->interval);
+ buffer[0] = '\0';
printf("<---- filter ---------> %s\n",
slapi_filter_to_string_internal((const struct slapi_filter *)entry->filter, buffer,
&bufsiz));
printf("<---- generate flag --> %s\n", entry->generate);
Show replies by date