ITS#357: at_cn == NULL causes crash

This commit is contained in:
Kurt Zeilenga 1999-11-17 22:43:07 +00:00
parent be51328c8b
commit 8032f5885d
2 changed files with 16 additions and 2 deletions

View File

@ -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,

View File

@ -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 );
}