From: Kurt Zeilenga Date: Wed, 17 Nov 1999 22:43:07 +0000 (+0000) Subject: ITS#357: at_cn == NULL causes crash X-Git-Tag: UCDATA_2_4~202 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8032f5885d756d989af60d2b606088c9c0b07a13;p=openldap ITS#357: at_cn == NULL causes crash --- diff --git a/servers/slapd/back-bdb2/index.c b/servers/slapd/back-bdb2/index.c index 6ef1ca2f73..4c078b5790 100644 --- a/servers/slapd/back-bdb2/index.c +++ b/servers/slapd/back-bdb2/index.c @@ -124,6 +124,13 @@ bdb2i_index_read( attr_normalize( type ); at_cn = at_canonical_name(type); + if ( at_cn == NULL ) { + Debug( LDAP_DEBUG_ANY, + "<= bdb2i_index_read no canonical name for type \"%s\"\n", + type != NULL ? type : "(NULL)", 0, 0 ); + return( NULL ); + } + if ( (db = bdb2i_cache_open( be, at_cn, BDB2_SUFFIX, LDBM_WRCREAT )) == NULL ) { Debug( LDAP_DEBUG_ANY, diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 12db542582..d3b0795304 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -148,11 +148,18 @@ index_read( attr_normalize( type ); at_cn = at_canonical_name( type ); + if ( at_cn == NULL ) { + Debug( LDAP_DEBUG_ANY, + "<= index_read no canonical name for type \"%s\"\n", + type != NULL ? type : "(NULL)", 0, 0 ); + return( NULL ); + } + if ( (db = ldbm_cache_open( be, at_cn, LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { Debug( LDAP_DEBUG_ANY, - "<= index_read NULL (could not open %s%s)\n", at_cn, - LDBM_SUFFIX, 0 ); + "<= index_read NULL (could not open %s%s)\n", + at_cn, LDBM_SUFFIX, 0 ); return( NULL ); }