catch invalid read (i == -1)

This commit is contained in:
Pierangelo Masarati 2006-12-18 01:28:43 +00:00
parent 23423cd086
commit 7bcbd40344

View file

@ -901,16 +901,17 @@ int slap_mods_check(
}
}
done:
j = ix[i];
slap_sl_free( ix, ctx );
if ( rc != LDAP_SUCCESS ) {
return rc;
} else if ( match == 0 ) {
/* value exists already */
assert( i >= 0 );
assert( i < nvals );
snprintf( textbuf, textlen,
"%s: value #%d provided more than once",
ml->sml_desc->ad_cname.bv_val, j );
ml->sml_desc->ad_cname.bv_val, ix[i] );
*text = textbuf;
return LDAP_TYPE_OR_VALUE_EXISTS;
}