case LDAP_FILTER_NOT:
case LDAP_FILTER_OR: {
int rc;
- Filter *f;
+ /*
+ * FIXME: altering f; should we use a temporary?
+ */
for ( f = f->f_list; f != NULL; f = f->f_next ) {
rc = slapi_filter_apply( f, fn, arg, error_code );
if ( rc != 0 ) {
mod->sml_next = NULL;
if ( (*modp)->mod_op & LDAP_MOD_BVALUES ) {
- for( i = 0, bvp = (*modp)->mod_bvalues; *bvp != NULL; bvp++, i++ )
+ for( i = 0, bvp = (*modp)->mod_bvalues; bvp != NULL && *bvp != NULL; bvp++, i++ )
;
} else {
- for( i = 0, p = (*modp)->mod_values; *p != NULL; p++, i++ )
+ for( i = 0, p = (*modp)->mod_values; p != NULL && *p != NULL; p++, i++ )
;
}
/* NB: This implicitly trusts a plugin to return valid modifications. */
if ( (*modp)->mod_op & LDAP_MOD_BVALUES ) {
- for( i = 0, bvp = (*modp)->mod_bvalues; *bvp != NULL; bvp++, i++ ) {
+ for( i = 0, bvp = (*modp)->mod_bvalues; bvp != NULL && *bvp != NULL; bvp++, i++ ) {
mod->sml_bvalues[i].bv_val = (*bvp)->bv_val;
mod->sml_bvalues[i].bv_len = (*bvp)->bv_len;
}
} else {
- for( i = 0, p = (*modp)->mod_values; *p != NULL; p++, i++ ) {
+ for( i = 0, p = (*modp)->mod_values; p != NULL && *p != NULL; p++, i++ ) {
mod->sml_bvalues[i].bv_val = *p;
mod->sml_bvalues[i].bv_len = strlen( *p );
}
* Modification list. Do free the containing array.
*/
if ( mods[i]->mod_op & LDAP_MOD_BVALUES ) {
- for ( j = 0; mods[i]->mod_bvalues[j] != NULL; j++ ) {
+ for ( j = 0; mods[i]->mod_bvalues != NULL && mods[i]->mod_bvalues[j] != NULL; j++ ) {
ch_free( mods[i]->mod_bvalues[j] );
}
ch_free( mods[i]->mod_bvalues );