]> git.sur5r.net Git - openldap/commitdiff
check parameters
authorPierangelo Masarati <ando@openldap.org>
Sat, 9 Apr 2005 00:11:31 +0000 (00:11 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 9 Apr 2005 00:11:31 +0000 (00:11 +0000)
servers/slapd/back-monitor/database.c
servers/slapd/bconfig.c

index 1deed07e7d9e17914984b478ab8c9bafe31cf8cd..8aa38f6c523af5f428740f8b89d3294e3fdb52c8 100644 (file)
@@ -227,6 +227,13 @@ monitor_subsys_database_init(
                                        be->be_suffix, be->be_nsuffix );
 
                } else {
+                       if ( be->be_suffix == NULL ) {
+                               Debug( LDAP_DEBUG_ANY,
+                                       "monitor_subsys_database_init: "
+                                       "missing suffix for database %d\n",
+                                       i, 0, 0 );
+                               return -1;
+                       }
                        attr_merge( e, slap_schema.si_ad_namingContexts,
                                        be->be_suffix, be->be_nsuffix );
                        attr_merge( e_database, slap_schema.si_ad_namingContexts,
index 816dd7a260795efb460864c73af71a6b81fc96f9..b987df1d7ae383683e82c020f6e2bbaa71279beb 100644 (file)
@@ -1397,12 +1397,14 @@ config_suffix(ConfigArgs *c) {
                SLAP_CONFIG(c->be)) return 1;
 
        if (c->op == SLAP_CONFIG_EMIT) {
-               if (!BER_BVISNULL( &c->be->be_suffix[0] )) {
+               if ( c->be->be_suffix == NULL
+                               || BER_BVISNULL( &c->be->be_suffix[0] ) )
+               {
+                       return 1;
+               } else {
                        value_add( &c->rvalue_vals, c->be->be_suffix );
                        value_add( &c->rvalue_nvals, c->be->be_nsuffix );
                        return 0;
-               } else {
-                       return 1;
                }
        }
 #ifdef SLAPD_MONITOR_DN