]> git.sur5r.net Git - openldap/commitdiff
ITS#357: at_cn == NULL causes crash
authorKurt Zeilenga <kurt@openldap.org>
Wed, 17 Nov 1999 22:43:07 +0000 (22:43 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 17 Nov 1999 22:43:07 +0000 (22:43 +0000)
servers/slapd/back-bdb2/index.c
servers/slapd/back-ldbm/index.c

index 6ef1ca2f73721c67ff4c661c4ea7566f033583f1..4c078b5790265a1594642b362fd3c6d81b8196e2 100644 (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,
index 12db542582c9d05017050f3ff771b1f21de44a80..d3b0795304ef01c2d5e88bb60d50ae629dbfc0a7 100644 (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 );
        }