From 09e4da6bef50d41f1e017b8c21022e81b457d8da Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 9 Apr 2005 00:11:31 +0000 Subject: [PATCH] check parameters --- servers/slapd/back-monitor/database.c | 7 +++++++ servers/slapd/bconfig.c | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 1deed07e7d..8aa38f6c52 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -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, diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 816dd7a260..b987df1d7a 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -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 -- 2.39.5