diff options
| author | Rich Megginson <rmeggins@redhat.com> | 2007-10-18 22:25:14 +0000 |
|---|---|---|
| committer | Rich Megginson <rmeggins@redhat.com> | 2007-10-18 22:25:14 +0000 |
| commit | d81e2fa8e34a5b8d0ceb9d35e106ba1b1cc66496 (patch) | |
| tree | 5224ff818b185420e4fa6bc655e4684ba011adbb /ldap/servers/plugins/dna | |
| parent | 0679cf419684a327572289ee381411ea4db92166 (diff) | |
| download | ds-d81e2fa8e34a5b8d0ceb9d35e106ba1b1cc66496.tar.gz ds-d81e2fa8e34a5b8d0ceb9d35e106ba1b1cc66496.tar.xz ds-d81e2fa8e34a5b8d0ceb9d35e106ba1b1cc66496.zip | |
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
Diffstat (limited to 'ldap/servers/plugins/dna')
| -rw-r--r-- | ldap/servers/plugins/dna/dna.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c index 2541bdf8..eff85cce 100644 --- a/ldap/servers/plugins/dna/dna.c +++ b/ldap/servers/plugins/dna/dna.c @@ -512,7 +512,12 @@ static int parseConfigEntry(Slapi_Entry *e) 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 @@ void dnaDumpConfigEntry(configEntry *entry) 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); |
