From: Kurt Zeilenga Date: Wed, 28 Jul 1999 22:57:52 +0000 (+0000) Subject: Fix index_change_vals NULL vals bug (ITS#238) X-Git-Tag: OPENLDAP_REL_ENG_2_BP~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0e4e5c7a13d79a29138165d853479fd8b9800264;p=openldap Fix index_change_vals NULL vals bug (ITS#238) --- diff --git a/servers/slapd/back-bdb2/index.c b/servers/slapd/back-bdb2/index.c index 8994f14b6b..825a97e3bd 100644 --- a/servers/slapd/back-bdb2/index.c +++ b/servers/slapd/back-bdb2/index.c @@ -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 ); diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 444d079179..88d279b888 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -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 );