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

index 4c078b5790265a1594642b362fd3c6d81b8196e2..d21fc45ed33316a95833d19ad16eb338449e4101 100644 (file)
@@ -254,8 +254,16 @@ bdb2i_index_add_values(
        if ( indexmask == 0 ) {
                return( 0 );
        }
+
        at_cn = at_canonical_name(type);
 
+       if ( at_cn == NULL ) {
+               Debug( LDAP_DEBUG_ANY,
+                   "<= bdb2i_index_add_values no canonical name for type \"%s\"\n",
+                       type != NULL ? type : "(NULL)", 0, 0 );
+               return( -1 );
+       }
+
        if ( (db = bdb2i_cache_open( be, at_cn, BDB2_SUFFIX, LDBM_WRCREAT ))
            == NULL ) {
                Debug( LDAP_DEBUG_ANY,
index d3b0795304ef01c2d5e88bb60d50ae629dbfc0a7..7c6f8a7a0294860470a637a56b1a14e1142ebf2a 100644 (file)
@@ -314,12 +314,18 @@ index_change_values(
 
        at_cn = at_canonical_name( type );
 
+       if ( at_cn == NULL ) {
+               Debug( LDAP_DEBUG_ANY,
+                   "<= index_change_values no canonical name for type \"%s\"\n",
+                       type != NULL ? type : "(NULL)", 0, 0 );
+               return( -1 );
+       }
+
        if ( (db = ldbm_cache_open( be, at_cn, LDBM_SUFFIX, mode ))
             == NULL ) {
                Debug( LDAP_DEBUG_ANY,
                       "<= index_change_values (couldn't open(%s%s),md=%s)\n",
-                      at_cn,
-                      LDBM_SUFFIX,
+                      at_cn, LDBM_SUFFIX,
                       ((mode==LDBM_WRCREAT)?"LDBM_WRCREAT":"LDBM_WRITER") );
                return( -1 );
        }