if ( a && ( ad->ad_type->sat_flags & SLAP_AT_ORDERED_VAL )) {
sort = 1;
rc = ordered_value_sort( a, 1 );
- if ( rc )
+ if ( rc ) {
+ sprintf(ca->msg, "ordered_value_sort failed on attr %s\n",
+ ad->ad_cname.bv_val );
return rc;
+ }
}
for ( i=0; vals[i].bv_val; i++ ) {
ca->line = vals[i].bv_val;
char *ptr;
index = 1;
ptr = strchr( a->a_vals[i].bv_val, '}' );
- if ( !ptr || !ptr[1] )
+ if ( !ptr )
return LDAP_INVALID_SYNTAX;
if ( noindex )
return LDAP_INVALID_SYNTAX;
#endif
indexes = ch_malloc( vals * sizeof(int) );
- for ( i=0; i<vals; i++)
- indexes[i] = strtol(a->a_vals[i].bv_val+1, NULL, 0);
+ for ( i=0; i<vals; i++) {
+ char *ptr;
+ indexes[i] = strtol(a->a_vals[i].bv_val+1, &ptr, 0);
+ if ( *ptr != '}' ) {
+ ch_free( indexes );
+ return LDAP_INVALID_SYNTAX;
+ }
+ }
/* Insertion sort */
for ( i=1; i<vals; i++ ) {