]> git.sur5r.net Git - openldap/commitdiff
Fix index_change_vals NULL vals bug (ITS#238)
authorKurt Zeilenga <kurt@openldap.org>
Wed, 28 Jul 1999 22:57:52 +0000 (22:57 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 28 Jul 1999 22:57:52 +0000 (22:57 +0000)
servers/slapd/back-bdb2/index.c
servers/slapd/back-ldbm/index.c

index 8994f14b6bd9dc79fe541cb39f63e035b0924b29..825a97e3bd051b8f3e4cf206079ee5536af9dfbc 100644 (file)
@@ -248,7 +248,8 @@ bdb2i_index_add_values(
                return( -1 );
        }
 
-       for ( i = 0; vals[i] != NULL; i++ ) {
+       if( vals != NULL ) {
+         for ( i = 0; vals[i] != NULL; i++ ) {
                /*
                 * presence index entry
                 */
@@ -340,6 +341,7 @@ bdb2i_index_add_values(
                if ( bigbuf != NULL ) {
                        free( bigbuf );
                }
+         }
        }
        bdb2i_cache_close( be, db );
 
index 444d079179a792777dd97c3ffb689de15a2bce59..88d279b8882f37da5c64ed354f1ed3c9fbf1f9b1 100644 (file)
@@ -306,7 +306,8 @@ index_change_values(
        }
 
 
-       for ( i = 0; vals[i] != NULL; i++ ) {
+       if ( vals != NULL ) {
+         for ( i = 0; vals[i] != NULL; i++ ) {
                /*
                 * presence index entry
                 */
@@ -416,7 +417,9 @@ index_change_values(
                if ( bigbuf != NULL ) {
                        free( bigbuf );
                }
+         }
        }
+
        ldbm_cache_close( be, db );
 
        return( 0 );